]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/cfhd: Check transform type
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 27 Aug 2020 22:17:41 +0000 (00:17 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 30 Aug 2020 14:18:37 +0000 (16:18 +0200)
Fixes: out of array access
Fixes: 24823/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CFHD_fuzzer-4855119863349248
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/cfhd.c

index d014aa2bb7111e7ec1517377f1a929da592f75d2..ea35f03869b5d225e491de1e931849c3a5830cbd 100644 (file)
@@ -490,6 +490,10 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
                 av_log(avctx, AV_LOG_ERROR, "Invalid transform type\n");
                 ret = AVERROR(EINVAL);
                 break;
+            } else if (data == 1) {
+                av_log(avctx, AV_LOG_ERROR, "unsupported transform type\n");
+                ret = AVERROR_PATCHWELCOME;
+                break;
             }
             s->transform_type = data;
             av_log(avctx, AV_LOG_DEBUG, "Transform type %"PRIu16"\n", data);