diff options
author | Martin Storsjö <martin@martin.st> | 2013-09-11 22:19:28 +0300 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2014-01-07 09:43:56 +0100 |
commit | 7d8a4bb8d2ca8d12043ec78d2546323e3a35114f (patch) | |
tree | 7b1609d63db998fc98cd1ff90311ce1bb1331edd /libavcodec | |
parent | 712945d21e63f6b3bb954b6555ecd79c36a57f42 (diff) | |
download | ffmpeg-7d8a4bb8d2ca8d12043ec78d2546323e3a35114f.tar.gz |
shorten: Break out of loop looking for fmt chunk if none is found
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit b26742cc308552f242ee2bf93b07a3ff509f4edc)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/shorten.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c index 5231ce404e..7d51c56acd 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); |