diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-12-25 18:41:58 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-03-24 10:38:51 +0100 |
commit | b2fd3250c4a559d2941a6940c3e3190d4beabe25 (patch) | |
tree | 935b82e4815d048d2a312a49273cb2d315d51614 /libavcodec/exr.c | |
parent | d43b488340105e09bf378795bd621ebe1520594b (diff) | |
download | ffmpeg-b2fd3250c4a559d2941a6940c3e3190d4beabe25.tar.gz |
avcodec/exr: Check for duplicate channel index
Fixes: Out of memory
Fixes: 11582/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5730204559867904
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f9728feaf90eb7493f8872356f54150efafb59cc)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/exr.c')
-rw-r--r-- | libavcodec/exr.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/exr.c b/libavcodec/exr.c index ff31d7267c..e7a6146f0e 100644 --- a/libavcodec/exr.c +++ b/libavcodec/exr.c @@ -1461,6 +1461,11 @@ static int decode_header(EXRContext *s, AVFrame *frame) } s->pixel_type = current_pixel_type; s->channel_offsets[channel_index] = s->current_channel_offset; + } else if (channel_index >= 0) { + av_log(s->avctx, AV_LOG_ERROR, + "Multiple channels with index %d.\n", channel_index); + ret = AVERROR_INVALIDDATA; + goto fail; } s->channels = av_realloc(s->channels, |