Browse code

avcodec/utils: Add case for jv to avcodec_align_dimensions2()

Fixes out of array accesses
Fixes: asan_heap-oob_12304aa_8_asan_heap-oob_4da4f3_300_intro.jv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 105654e376a736d243aef4a1d121abebce912e6b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2014/10/03 11:30:58
Showing 1 changed files
... ...
@@ -388,6 +388,10 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
388 388
             w_align = 4;
389 389
             h_align = 4;
390 390
         }
391
+        if (s->codec_id == AV_CODEC_ID_JV) {
392
+            w_align = 8;
393
+            h_align = 8;
394
+        }
391 395
         break;
392 396
     case AV_PIX_FMT_BGR24:
393 397
         if ((s->codec_id == AV_CODEC_ID_MSZH) ||