changeset 8083:1fe764a5c33e libavcodec

Fix av_picture_copy missing pixels on packed planar AVPictures with odd size. patch by Art Clarke, aclarke vlideshow com
author diego
date Wed, 29 Oct 2008 23:07:49 +0000
parents 75d40b4b28ed
children 8547a4ae101b
files imgconvert.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/imgconvert.c	Wed Oct 29 21:08:14 2008 +0000
+++ b/imgconvert.c	Wed Oct 29 23:07:49 2008 +0000
@@ -870,7 +870,7 @@
         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 @@
             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],