[FFmpeg-cvslog] xl: Fix overreads
Aneesh Dogra
git at videolan.org
Tue Dec 20 04:18:11 CET 2011
ffmpeg | branch: master | Aneesh Dogra <lionaneesh at gmail.com> | Tue Dec 20 00:18:30 2011 +0530| [00aad121d8a6f365641345a8321bdaac1ff80649] | committer: Martin Storsjö
xl: Fix overreads
Signed-off-by: Martin Storsjö <martin at martin.st>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=00aad121d8a6f365641345a8321bdaac1ff80649
---
libavcodec/xl.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/libavcodec/xl.c b/libavcodec/xl.c
index 197b0c2..0ebc946 100644
--- a/libavcodec/xl.c
+++ b/libavcodec/xl.c
@@ -68,6 +68,12 @@ static int decode_frame(AVCodecContext *avctx,
V = a->pic.data[2];
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++) {
/* lines are stored in reversed order */
buf += stride;
More information about the ffmpeg-cvslog
mailing list