[FFmpeg-cvslog] avformat/hnm: check chunk_size == 0
Michael Niedermayer
git at videolan.org
Sat Nov 23 01:18:21 CET 2013
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Nov 22 23:44:57 2013 +0100| [5c4aa72b75c1715d031df38d925445698be67de4] | committer: Michael Niedermayer
avformat/hnm: check chunk_size == 0
Fixes potential infinite loop
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5c4aa72b75c1715d031df38d925445698be67de4
---
libavformat/hnm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavformat/hnm.c b/libavformat/hnm.c
index e315414..47a1808 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);
More information about the ffmpeg-cvslog
mailing list