[FFmpeg-cvslog] shorten: Break out of loop looking for fmt chunk if none is found

Martin Storsjö git at videolan.org
Thu Jan 16 21:51:28 CET 2014


ffmpeg | branch: release/0.10 | Martin Storsjö <martin at martin.st> | Wed Sep 11 22:19:28 2013 +0300| [7d8a4bb8d2ca8d12043ec78d2546323e3a35114f] | committer: Luca Barbato

shorten: Break out of loop looking for fmt chunk if none is found

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org
Signed-off-by: Martin Storsjö <martin at martin.st>
(cherry picked from commit b26742cc308552f242ee2bf93b07a3ff509f4edc)
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7d8a4bb8d2ca8d12043ec78d2546323e3a35114f
---

 libavcodec/shorten.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index 5231ce4..7d51c56 100644
--- a/libavcodec/shorten.c
+++ b/libavcodec/shorten.c
@@ -224,6 +224,10 @@ static int decode_wave_header(AVCodecContext *avctx, const uint8_t *header,
     while (bytestream2_get_le32(&gb) != MKTAG('f', 'm', 't', ' ')) {
         len = bytestream2_get_le32(&gb);
         bytestream2_skip(&gb, len);
+        if (bytestream2_get_bytes_left(&gb) < 16) {
+            av_log(avctx, AV_LOG_ERROR, "no fmt chunk found\n");
+            return AVERROR_INVALIDDATA;
+        }
     }
     len = bytestream2_get_le32(&gb);
 



More information about the ffmpeg-cvslog mailing list