avcodec/utils: correct align value for interplay
authorMichael Niedermayer <michael@niedermayer.cc>
Tue, 24 Jan 2017 23:20:19 +0000 (00:20 +0100)
committerMike Gabriel <sunweaver@debian.org>
Sat, 31 Aug 2019 15:36:55 +0000 (16:36 +0100)
Fixes out of array access
Fixes: 452/fuzz-1-ffmpeg_VIDEO_AV_CODEC_ID_INTERPLAY_VIDEO_fuzzer
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Gbp-Pq: Name CVE-2017-7865.patch

libavcodec/utils.c

index 5a3e95284bb53ebf3dd31056816e1d14aa0076b1..3c934a037e6967c6a9b6ea773eaa372138a26753 100644 (file)
@@ -247,6 +247,10 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
             w_align = 4;
             h_align = 4;
         }
+        if (s->codec_id == AV_CODEC_ID_INTERPLAY_VIDEO) {
+            w_align = 8;
+            h_align = 8;
+        }
     case AV_PIX_FMT_PAL8:
     case AV_PIX_FMT_BGR8:
     case AV_PIX_FMT_RGB8:
@@ -254,7 +258,8 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
             w_align = 4;
             h_align = 4;
         }
-        if (s->codec_id == AV_CODEC_ID_JV) {
+        if (s->codec_id == AV_CODEC_ID_JV ||
+            s->codec_id == AV_CODEC_ID_INTERPLAY_VIDEO) {
             w_align = 8;
             h_align = 8;
         }