[FFmpeg-devel] [PATCH] odd-height RGB->yuv420 fix invalid reads

Reimar Döffinger Reimar.Doeffinger
Thu Oct 7 21:35:37 CEST 2010


Hello,
while it will leave the last line(s) uninitialized (do they even exist/will
they have been allocated?), below patch fixes the out-of-bounds reads.
Should fix the crash part of issue 2279.
Index: libswscale/rgb2rgb_template.c
===================================================================
--- libswscale/rgb2rgb_template.c       (revision 32448)
+++ libswscale/rgb2rgb_template.c       (working copy)
@@ -2239,7 +2239,7 @@
 #else
     y=0;
 #endif
-    for (; y<height; y+=2) {
+    for (; y<height-1; y+=2) {
         long i;
         for (i=0; i<chromWidth; i++) {
             unsigned int b = src[6*i+0];




More information about the ffmpeg-devel mailing list