Commit 00aad121 authored by Aneesh Dogra's avatar Aneesh Dogra Committed by Martin Storsjö

xl: Fix overreads

Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent 1c668624
...@@ -68,6 +68,12 @@ static int decode_frame(AVCodecContext *avctx, ...@@ -68,6 +68,12 @@ static int decode_frame(AVCodecContext *avctx,
V = a->pic.data[2]; V = a->pic.data[2];
stride = avctx->width - 4; stride = avctx->width - 4;
if (buf_size < avctx->width * avctx->height) {
av_log(avctx, AV_LOG_ERROR, "Packet is too small\n");
return AVERROR_INVALIDDATA;
}
for (i = 0; i < avctx->height; i++) { for (i = 0; i < avctx->height; i++) {
/* lines are stored in reversed order */ /* lines are stored in reversed order */
buf += stride; buf += stride;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment