aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-11-22 23:44:57 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-11-22 23:52:08 +0100
commit5c4aa72b75c1715d031df38d925445698be67de4 (patch)
treee127715195eeb47dce0ccd354bde0b8e95e90d7b
parentbd8d28e2d2713f0368ee6b7dbb5ec251cbc162ac (diff)
downloadffmpeg-5c4aa72b75c1715d031df38d925445698be67de4.tar.gz
avformat/hnm: check chunk_size == 0
Fixes potential infinite loop Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/hnm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/hnm.c b/libavformat/hnm.c
index e3154141f5..47a1808afb 100644
--- a/libavformat/hnm.c
+++ b/libavformat/hnm.c
@@ -148,7 +148,7 @@ static int hnm_read_packet(AVFormatContext *s, AVPacket *pkt)
chunk_id = avio_rl16(pb);
avio_skip(pb, 2);
- if (chunk_size > hnm->superchunk_remaining) {
+ if (chunk_size > hnm->superchunk_remaining || !chunk_size) {
av_log(s, AV_LOG_ERROR, "invalid chunk size: %u, offset: %u\n",
chunk_size, (int) avio_tell(pb));
avio_skip(pb, hnm->superchunk_remaining - 8);