summaryrefslogtreecommitdiff
path: root/libavcodec/mjpeg.c
diff options
context:
space:
mode:
authorArpi <arpi@thot.banki.hu>2002-10-27 19:20:02 +0000
committerArpi <arpi@thot.banki.hu>2002-10-27 19:20:02 +0000
commit055317a74c179d5e849d9723eb08b0c005e0c0cc (patch)
treeddb8d350f15dc45b37f294e501e7f3f63597d619 /libavcodec/mjpeg.c
parent9d3748bed3d2e03993c32cf87c12a7f0039d061c (diff)
3rd 10l - don't let it read data beyond the end of frame
Originally committed as revision 1083 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mjpeg.c')
-rw-r--r--libavcodec/mjpeg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/mjpeg.c b/libavcodec/mjpeg.c
index 7ca1601086..2360d7ff80 100644
--- a/libavcodec/mjpeg.c
+++ b/libavcodec/mjpeg.c
@@ -1283,7 +1283,7 @@ static int mjpeg_decode_frame(AVCodecContext *avctx,
while (src<buf_end)
{
- unsigned char x = *(src++);
+ UINT8 x = *(src++);
*(dst++) = x;
if (x == 0xff)
@@ -1295,7 +1295,7 @@ static int mjpeg_decode_frame(AVCodecContext *avctx,
break;
}
}
- init_get_bits(&s->gb, s->buffer, s->buffer_size);
+ init_get_bits(&s->gb, s->buffer, dst - s->buffer);
}
else
init_get_bits(&s->gb, buf_ptr, buf_end - buf_ptr);