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

ramiro subversion
Mon Nov 22 04:46:32 CET 2010


Author: ramiro
Date: Mon Nov 22 04:46:31 2010
New Revision: 25793

Log:
fix pointer truncation to int in avpicture_layout()

Modified:
   trunk/libavcodec/imgconvert.c

Modified: trunk/libavcodec/imgconvert.c
==============================================================================
--- trunk/libavcodec/imgconvert.c	Sun Nov 21 22:25:06 2010	(r25792)
+++ trunk/libavcodec/imgconvert.c	Mon Nov 22 04:46:31 2010	(r25793)
@@ -503,10 +503,10 @@ int avpicture_layout(const AVPicture* sr
 
     av_image_fill_linesizes(linesizes, pix_fmt, width);
     for (i = 0; i < nb_planes; i++) {
-        int h, s = (i == 1 || i == 2) ? desc->log2_chroma_h : 0;
-        h = (height + (1 << s) - 1) >> s;
+        int h, shift = (i == 1 || i == 2) ? desc->log2_chroma_h : 0;
+        const unsigned char *s = src->data[i];
+        h = (height + (1 << shift) - 1) >> shift;
 
-        s = src->data[i];
         for (j = 0; j < h; j++) {
             memcpy(dest, s, linesizes[i]);
             dest += linesizes[i];



More information about the ffmpeg-cvslog mailing list