diff options
author | Paul B Mahol <onemda@gmail.com> | 2012-07-19 17:56:55 +0000 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2012-07-20 18:13:25 +0000 |
commit | a2dab7512e7c5d0e0e19e945880d80de3e4df0d2 (patch) | |
tree | 20a577450a955457dc8453c231cc39b2be015126 | |
parent | 55de89e25d1ae1a86d792e1ebecebcad702980f6 (diff) | |
download | ffmpeg-a2dab7512e7c5d0e0e19e945880d80de3e4df0d2.tar.gz |
exr: compression attribute is mandatory
Do not continue decoding if one is missing.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
-rw-r--r-- | libavcodec/exr.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/exr.c b/libavcodec/exr.c index f175706a3d..4945ad7eb2 100644 --- a/libavcodec/exr.c +++ b/libavcodec/exr.c @@ -446,6 +446,11 @@ static int decode_frame(AVCodecContext *avctx, } } + if (s->compr == -1) { + av_log(avctx, AV_LOG_ERROR, "Missing compression attribute\n"); + return AVERROR_INVALIDDATA; + } + if (buf >= buf_end) { av_log(avctx, AV_LOG_ERROR, "Incomplete frame\n"); return AVERROR_INVALIDDATA; @@ -642,6 +647,8 @@ static av_cold int decode_init(AVCodecContext *avctx) avcodec_get_frame_defaults(&s->picture); avctx->coded_frame = &s->picture; + s->compr = -1; + return 0; } |