summaryrefslogtreecommitdiff
path: root/libavcodec/dxa.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-10-28 15:26:42 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-10-28 15:30:05 +0100
commite70312dfc22c4e54d5716f28f28db8f99c74cc90 (patch)
tree0301032c5aefa5f9fc8356854ba6d155bb44c921 /libavcodec/dxa.c
parentbeb944786e62f204c68883e22a98de9e877ca7de (diff)
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@gmx.at>
Diffstat (limited to 'libavcodec/dxa.c')
-rw-r--r--libavcodec/dxa.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/dxa.c b/libavcodec/dxa.c
index 0f64b5e619..c8e3f71399 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);