mirror of https://git.ffmpeg.org/ffmpeg.git
exr: check version too
Separate version from flags. Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
parent
8902f5b89c
commit
3456891291
|
@ -236,7 +236,7 @@ static int decode_frame(AVCodecContext *avctx,
|
||||||
AVFrame *const p = &s->picture;
|
AVFrame *const p = &s->picture;
|
||||||
uint8_t *ptr;
|
uint8_t *ptr;
|
||||||
|
|
||||||
int i, x, y, stride, magic_number, version_flag, ret;
|
int i, x, y, stride, magic_number, version, flags, ret;
|
||||||
int w = 0;
|
int w = 0;
|
||||||
int h = 0;
|
int h = 0;
|
||||||
unsigned int xmin = ~0;
|
unsigned int xmin = ~0;
|
||||||
|
@ -271,8 +271,14 @@ static int decode_frame(AVCodecContext *avctx,
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
version_flag = bytestream_get_le32(&buf);
|
version = bytestream_get_byte(&buf);
|
||||||
if ((version_flag & 0x200) == 0x200) {
|
if (version != 2) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "Unsupported version %d\n", version);
|
||||||
|
return AVERROR_PATCHWELCOME;
|
||||||
|
}
|
||||||
|
|
||||||
|
flags = bytestream_get_le24(&buf);
|
||||||
|
if (flags & 0x2) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Tile based images are not supported\n");
|
av_log(avctx, AV_LOG_ERROR, "Tile based images are not supported\n");
|
||||||
return AVERROR_PATCHWELCOME;
|
return AVERROR_PATCHWELCOME;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue