[FFmpeg-devel] [PATCH 1/2] issdemux: Check packet_size for validity

Michael Niedermayer michaelni at gmx.at
Thu Dec 29 05:28:36 CET 2011


Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavformat/iss.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/libavformat/iss.c b/libavformat/iss.c
index 2bae3c1..bbc8465 100644
--- a/libavformat/iss.c
+++ b/libavformat/iss.c
@@ -87,6 +87,11 @@ static av_cold int iss_read_header(AVFormatContext *s, AVFormatParameters *ap)
     get_token(pb, token, sizeof(token)); //Version ID
     get_token(pb, token, sizeof(token)); //Size
 
+    if (iss->packet_size <= 0) {
+        av_log(s, AV_LOG_ERROR, "packet_size %d is invalid\n", iss->packet_size);
+        return AVERROR_INVALIDDATA;
+    }
+
     iss->sample_start_pos = avio_tell(pb);
 
     st = avformat_new_stream(s, NULL);
-- 
1.7.5.4



More information about the ffmpeg-devel mailing list