aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-08-28 00:17:41 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-08-30 16:18:37 +0200
commit659658d08bb2e7219001795c78efd24f381446e2 (patch)
treed417b522e25c2b2e143cdaf783a94a9fdeb1a3da
parentb54c7797c515dd050a39d8d00e75eab726c3c7c3 (diff)
downloadffmpeg-659658d08bb2e7219001795c78efd24f381446e2.tar.gz
avcodec/cfhd: Check transform type
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>
-rw-r--r--libavcodec/cfhd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c
index d014aa2bb7..ea35f03869 100644
--- a/libavcodec/cfhd.c
+++ b/libavcodec/cfhd.c
@@ -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);