From d600e7bf25209e559b9708eb378d9ea647c8cdfc Mon Sep 17 00:00:00 2001 From: James Stembridge Date: Thu, 16 Oct 2003 22:03:36 +0000 Subject: Don't read off the end of the buffer CVS patchset: 5531 CVS date: 2003/10/16 22:03:36 --- src/libffmpeg/libavcodec/mjpeg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/libffmpeg/libavcodec/mjpeg.c b/src/libffmpeg/libavcodec/mjpeg.c index 7cab01c74..1b6b15c4a 100644 --- a/src/libffmpeg/libavcodec/mjpeg.c +++ b/src/libffmpeg/libavcodec/mjpeg.c @@ -1667,7 +1667,7 @@ static int find_marker(uint8_t **pbuf_ptr, uint8_t *buf_end) while (buf_ptr < buf_end) { v = *buf_ptr++; v2 = *buf_ptr; - if ((v == 0xff) && (v2 >= 0xc0) && (v2 <= 0xfe)) { + if ((buf_ptr < buf_end) && (v == 0xff) && (v2 >= 0xc0) && (v2 <= 0xfe)) { val = *buf_ptr++; goto found; } -- cgit v1.2.3