Commit 5c4aa72b authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/hnm: check chunk_size == 0

Fixes potential infinite loop
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent bd8d28e2
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment