Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-14 06:33:06 +0400
committerMichael Niedermayer <michaelni@gmx.at>2012-11-14 06:34:01 +0400
commit66ff90f4a3d81c25feaa672dc8cc9cc88017753d (patch)
tree59bea903dcd2890fd712c239eb4add8cabf46fb0 /libavcodec/8bps.c
parent7acee6654ccdbadea62e700970f789478febaa0c (diff)
8bps: check index against buffer size before reading line length pointer.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/8bps.c')
-rw-r--r--libavcodec/8bps.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/8bps.c b/libavcodec/8bps.c
index a6d0a1b92e..f895ed39a8 100644
--- a/libavcodec/8bps.c
+++ b/libavcodec/8bps.c
@@ -98,6 +98,8 @@ static int decode_frame(AVCodecContext *avctx, void *data,
for (row = 0; row < height; row++) {
pixptr = c->pic.data[0] + row * c->pic.linesize[0] + planemap[p];
pixptr_end = pixptr + c->pic.linesize[0];
+ if(lp - encoded + row*2 + 1 >= buf_size)
+ return -1;
dlen = av_be2ne16(*(const unsigned short *)(lp + row * 2));
/* Decode a row of this plane */
while (dlen > 0) {