From 116aa30db4ae28f0b67cb2861ea534bfb840f3bc Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Sun, 28 Jul 2013 18:24:15 +0200 Subject: [PATCH] xl: Make sure the width is valid CC: libav-stable@libav.org Signed-off-by: Luca Barbato --- libavcodec/xl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavcodec/xl.c b/libavcodec/xl.c index 1cadeab561..240339ea8b 100644 --- a/libavcodec/xl.c +++ b/libavcodec/xl.c @@ -71,6 +71,11 @@ static int decode_frame(AVCodecContext *avctx, stride = avctx->width - 4; + if (avctx->width % 4) { + av_log(avctx, AV_LOG_ERROR, "Width not a multiple of 4.\n"); + return AVERROR_INVALIDDATA; + } + if (buf_size < avctx->width * avctx->height) { av_log(avctx, AV_LOG_ERROR, "Packet is too small\n"); return AVERROR_INVALIDDATA;