summaryrefslogtreecommitdiff
path: root/libavcodec/imgconvert.c
diff options
context:
space:
mode:
authorArt Clarke <aclarke@vlideshow.com>2008-10-29 23:07:49 +0000
committerDiego Biurrun <diego@biurrun.de>2008-10-29 23:07:49 +0000
commita9a8c830cfbcbf898ae52429a389c88bb7912407 (patch)
treed03b2f692a80dd72dd5b112d0886b0baf45278ef /libavcodec/imgconvert.c
parenta56fbe2ac85a5a7258fa0cd91c608008ba3d15b4 (diff)
Fix av_picture_copy missing pixels on packed planar AVPictures with odd size.
patch by Art Clarke, aclarke vlideshow com Originally committed as revision 15744 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/imgconvert.c')
-rw-r--r--libavcodec/imgconvert.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c
index 2087a171f0..c418be2bf0 100644
--- a/libavcodec/imgconvert.c
+++ b/libavcodec/imgconvert.c
@@ -870,7 +870,7 @@ int ff_get_plane_bytewidth(enum PixelFormat pix_fmt, int width, int plane)
break;
case FF_PIXEL_PLANAR:
if (plane == 1 || plane == 2)
- width >>= pf->x_chroma_shift;
+ width= -((-width)>>pf->x_chroma_shift);
return (width * pf->depth + 7) >> 3;
break;
@@ -900,7 +900,7 @@ void av_picture_copy(AVPicture *dst, const AVPicture *src,
h = height;
if (i == 1 || i == 2) {
w >>= pf->x_chroma_shift;
- h >>= pf->y_chroma_shift;
+ h= -((-height)>>pf->y_chroma_shift);
}
ff_img_copy_plane(dst->data[i], dst->linesize[i],
src->data[i], src->linesize[i],