[FFmpeg-cvslog] roqvideodec: fix a potential infinite loop in roqvideo_decode_frame().
Anton Khirnov
git at videolan.org
Sun Apr 7 15:54:20 CEST 2013
ffmpeg | branch: release/0.10 | Anton Khirnov <anton at khirnov.net> | Wed Mar 6 09:15:19 2013 +0100| [87e4f4c79a88212c4bc1a3e37a581ff88b9d9638] | committer: Reinhard Tartler
roqvideodec: fix a potential infinite loop in roqvideo_decode_frame().
When there is just 1 byte remanining in the buffer, nothing will be read
and the loop will continue forever. Check that there are at least 8
bytes, which are always read at the beginning.
CC:libav-stable at libav.org
(cherry picked from commit 3e2f200237af977b9253b0aff121eee27bcedb44)
Signed-off-by: Reinhard Tartler <siretart at tauware.de>
(cherry picked from commit 747fbe0c212b81952bb27ec7b99fa709081e2d63)
Conflicts:
libavcodec/roqvideodec.c
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=87e4f4c79a88212c4bc1a3e37a581ff88b9d9638
---
libavcodec/roqvideodec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/roqvideodec.c b/libavcodec/roqvideodec.c
index 0bf00cf..fe7863f 100644
--- a/libavcodec/roqvideodec.c
+++ b/libavcodec/roqvideodec.c
@@ -43,7 +43,7 @@ static void roqvideo_decode_frame(RoqContext *ri)
roq_qcell *qcell;
int64_t chunk_start;
- while (bytestream2_get_bytes_left(&ri->gb) > 0) {
+ while (bytestream2_get_bytes_left(&ri->gb) >= 8) {
chunk_id = bytestream2_get_le16(&ri->gb);
chunk_size = bytestream2_get_le32(&ri->gb);
chunk_arg = bytestream2_get_le16(&ri->gb);
More information about the ffmpeg-cvslog
mailing list