aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2013-09-11 22:19:28 +0300
committerMartin Storsjö <martin@martin.st>2013-09-12 10:53:04 +0300
commitb26742cc308552f242ee2bf93b07a3ff509f4edc (patch)
tree8fa51771e232ed435f099ecf912fa8daf016b34c
parent49568851bf1700e3d9ea9cda29208d0df3c2c38b (diff)
downloadffmpeg-b26742cc308552f242ee2bf93b07a3ff509f4edc.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>
-rw-r--r--libavcodec/shorten.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index 130bde6303..c394c52a26 100644
--- a/libavcodec/shorten.c
+++ b/libavcodec/shorten.c
@@ -221,6 +221,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);