[FFmpeg-cvslog] r13594 - trunk/libavcodec/imgconvert.c

bcoudurier subversion
Sun Jun 1 04:28:33 CEST 2008


Author: bcoudurier
Date: Sun Jun  1 04:28:33 2008
New Revision: 13594

Log:
memcpy considering output width, not src linesize, fix segv with av_picture_pad

Modified:
   trunk/libavcodec/imgconvert.c

Modified: trunk/libavcodec/imgconvert.c
==============================================================================
--- trunk/libavcodec/imgconvert.c	(original)
+++ trunk/libavcodec/imgconvert.c	Sun Jun  1 04:28:33 2008
@@ -2063,7 +2063,7 @@ int av_picture_pad(AVPicture *dst, const
             uint8_t *iptr = src->data[i];
             optr = dst->data[i] + dst->linesize[i] * (padtop >> y_shift) +
                     (padleft >> x_shift);
-            memcpy(optr, iptr, src->linesize[i]);
+            memcpy(optr, iptr, (width - padleft - padright) >> x_shift);
             iptr += src->linesize[i];
             optr = dst->data[i] + dst->linesize[i] * (padtop >> y_shift) +
                 (dst->linesize[i] - (padright >> x_shift));
@@ -2071,7 +2071,7 @@ int av_picture_pad(AVPicture *dst, const
             for (y = 0; y < yheight; y++) {
                 memset(optr, color[i], (padleft + padright) >> x_shift);
                 memcpy(optr + ((padleft + padright) >> x_shift), iptr,
-                    src->linesize[i]);
+                       (width - padleft - padright) >> x_shift);
                 iptr += src->linesize[i];
                 optr += dst->linesize[i];
             }




More information about the ffmpeg-cvslog mailing list