[FFmpeg-cvslog] avcodec/dxa: check dimensions

Michael Niedermayer git at videolan.org
Sat Nov 1 13:35:32 CET 2014


ffmpeg | branch: release/2.4 | Michael Niedermayer <michaelni at gmx.at> | Tue Oct 28 15:26:42 2014 +0100| [c7b7e0790c7bf2c799a4f07ae9f54f36c910323d] | committer: Michael Niedermayer

avcodec/dxa: check dimensions

Fixes out of array access
Fixes: asan_heap-oob_11222fb_21_020.dxa
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit e70312dfc22c4e54d5716f28f28db8f99c74cc90)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/dxa.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/dxa.c b/libavcodec/dxa.c
index 0f64b5e..c8e3f71 100644
--- a/libavcodec/dxa.c
+++ b/libavcodec/dxa.c
@@ -329,6 +329,11 @@ static av_cold int decode_init(AVCodecContext *avctx)
 {
     DxaDecContext * const c = avctx->priv_data;
 
+    if (avctx->width%4 || avctx->height%4) {
+        avpriv_request_sample(avctx, "dimensions are not a multiple of 4");
+        return AVERROR_INVALIDDATA;
+    }
+
     c->prev = av_frame_alloc();
     if (!c->prev)
         return AVERROR(ENOMEM);



More information about the ffmpeg-cvslog mailing list