diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2003-11-12 22:06:15 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-11-12 22:06:15 +0000 |
commit | 9515c0c10749a5c91c623bdde749f75e72d5afee (patch) | |
tree | 6b985776a384141f803fdd08aae759bb4def4d23 | |
parent | 7d5873594298d94f9945b53bbb82f1e83a82b8e5 (diff) | |
download | ffmpeg-9515c0c10749a5c91c623bdde749f75e72d5afee.tar.gz |
better fix
Originally committed as revision 2513 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/mjpeg.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/libavcodec/mjpeg.c b/libavcodec/mjpeg.c index 874d1a7050..78e7630a5c 100644 --- a/libavcodec/mjpeg.c +++ b/libavcodec/mjpeg.c @@ -1681,7 +1681,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 ((v == 0xff) && (v2 >= 0xc0) && (v2 <= 0xfe) && buf_ptr < buf_end) { val = *buf_ptr++; goto found; } @@ -1874,9 +1874,6 @@ not_the_end: } } the_end: - if(buf_ptr > buf_end) - buf_ptr = buf_end; - dprintf("mjpeg decode frame unused %d bytes\n", buf_end - buf_ptr); // return buf_end - buf_ptr; return buf_ptr - buf; |