]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/huffyuvdec: apply vertical filter in steps of 1 line for interlaced BGRA
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 25 Nov 2014 16:34:03 +0000 (17:34 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 25 Nov 2014 16:53:27 +0000 (17:53 +0100)
Fixes out of array read
Fixes: signal_sigsegv_3287332_2301_cov_2994954934_huffyuv.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/huffyuvdec.c

index 62ed0f97b1168ab6946a3f5a91dc6b31b1995f65..98c612847016dd3cec1cf2ac095038dbad889090 100644 (file)
@@ -1202,11 +1202,10 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
                     if (s->predictor == PLANE) {
                         if (s->bitstream_bpp != 32)
                             left[A] = 0;
-                        if ((y & s->interlaced) == 0 &&
-                            y < s->height - 1 - s->interlaced) {
+                        if (y < s->height - 1 - s->interlaced) {
                             s->hdsp.add_bytes(p->data[0] + p->linesize[0] * y,
                                               p->data[0] + p->linesize[0] * y +
-                                              fake_ystride, fake_ystride);
+                                              fake_ystride, 4 * width);
                         }
                     }
                 }