1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/exr: fix channel detection

This commit is contained in:
Martin Vignali 2016-04-07 11:17:18 +02:00 committed by Paul B Mahol
parent 7e1e25c2dc
commit 2dd7b46132

View File

@ -1382,15 +1382,17 @@ static int decode_header(EXRContext *s)
return AVERROR_PATCHWELCOME;
}
if (channel_index >= 0) {
if (s->pixel_type != EXR_UNKNOWN &&
s->pixel_type != current_pixel_type) {
av_log(s->avctx, AV_LOG_ERROR,
"RGB channels not of the same depth.\n");
return AVERROR_INVALIDDATA;
if (s->channel_offsets[channel_index] == -1){/* channel have not been previously assign */
if (channel_index >= 0) {
if (s->pixel_type != EXR_UNKNOWN &&
s->pixel_type != current_pixel_type) {
av_log(s->avctx, AV_LOG_ERROR,
"RGB channels not of the same depth.\n");
return AVERROR_INVALIDDATA;
}
s->pixel_type = current_pixel_type;
s->channel_offsets[channel_index] = s->current_channel_offset;
}
s->pixel_type = current_pixel_type;
s->channel_offsets[channel_index] = s->current_channel_offset;
}
s->channels = av_realloc(s->channels,