aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-09-26 15:40:30 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-01-06 11:30:43 +0100
commit25a7110651ee6c9913b027fe5460918bf8e3dbea (patch)
tree813f2f752fae70f9995fb8a753db6d4d70fc7bf1
parent9c2659f4abe6ddb3876edf46edd86854cd64a2e8 (diff)
downloadffmpeg-25a7110651ee6c9913b027fe5460918bf8e3dbea.tar.gz
avcodec/exr: Allow duplicate use of channel indexes
Fixes: Ticket #8203 Reported-by: durandal_1707 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 080819b3b4b59ef498511ac349414af85728349c) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/exr.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index 0f8b0fda9f..819837f024 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -1307,6 +1307,7 @@ static int decode_header(EXRContext *s, AVFrame *frame)
int magic_number, version, i, flags, sar = 0;
int layer_match = 0;
int ret;
+ int dup_channels = 0;
s->current_channel_offset = 0;
s->xmin = ~0;
@@ -1465,10 +1466,12 @@ 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,
+ av_log(s->avctx, AV_LOG_WARNING,
"Multiple channels with index %d.\n", channel_index);
- ret = AVERROR_INVALIDDATA;
- goto fail;
+ if (++dup_channels > 10) {
+ ret = AVERROR_INVALIDDATA;
+ goto fail;
+ }
}
s->channels = av_realloc(s->channels,