xl: Make sure the width is valid

CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
Luca Barbato
2013-07-28 18:24:15 +02:00
parent e6cf47ee9e
commit 116aa30db4

View File

@@ -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;