[FFmpeg-cvslog] exr: compression attribute is mandatory

Paul B Mahol git at videolan.org
Fri Jul 20 20:14:22 CEST 2012


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Thu Jul 19 17:56:55 2012 +0000| [a2dab7512e7c5d0e0e19e945880d80de3e4df0d2] | committer: Paul B Mahol

exr: compression attribute is mandatory

Do not continue decoding if one is missing.

Signed-off-by: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a2dab7512e7c5d0e0e19e945880d80de3e4df0d2
---

 libavcodec/exr.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index f175706..4945ad7 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;
 }
 



More information about the ffmpeg-cvslog mailing list