aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2013-02-20 10:32:22 +0000
committerPaul B Mahol <onemda@gmail.com>2013-02-22 18:59:54 +0000
commit3456891291024d97f167a5eea82b39e53a008843 (patch)
tree896f559c09b40aacdbd53fe4c541fb72ede616fd
parent8902f5b89c16dad1de4361efff191132ad08447b (diff)
downloadffmpeg-3456891291024d97f167a5eea82b39e53a008843.tar.gz
exr: check version too
Separate version from flags. Signed-off-by: Paul B Mahol <onemda@gmail.com>
-rw-r--r--libavcodec/exr.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index 46f816a95a..53b8e5c7db 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -236,7 +236,7 @@ static int decode_frame(AVCodecContext *avctx,
AVFrame *const p = &s->picture;
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 h = 0;
unsigned int xmin = ~0;
@@ -271,8 +271,14 @@ static int decode_frame(AVCodecContext *avctx,
return AVERROR_INVALIDDATA;
}
- version_flag = bytestream_get_le32(&buf);
- if ((version_flag & 0x200) == 0x200) {
+ version = bytestream_get_byte(&buf);
+ 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");
return AVERROR_PATCHWELCOME;
}