]> git.sesse.net Git - ffmpeg/commitdiff
rgb24toyv12: break out in the middle before out of array reads.
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 5 May 2011 00:20:20 +0000 (02:20 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 5 May 2011 00:20:20 +0000 (02:20 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libswscale/rgb2rgb_template.c

index 9293c460d524d5c7710563ddb5c37b36aa29120f..9af0eaa36697b600b60b0275bcb1b366b13f0b83 100644 (file)
@@ -2264,6 +2264,9 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_
         ydst += lumStride;
         src  += srcStride;
 
+        if(y+1 == height)
+            break;
+
         for (i=0; i<chromWidth; i++) {
             unsigned int b = src[6*i+0];
             unsigned int g = src[6*i+1];