diff --git a/libavcodec/exr.c b/libavcodec/exr.c index 5253cc3f13..13755e1e6e 100644 --- a/libavcodec/exr.c +++ b/libavcodec/exr.c @@ -1463,6 +1463,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,