From bf5cc805190b5811b786a454f01cccf9a7e366b9 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 29 Dec 2011 05:05:52 +0100 Subject: [PATCH] issdemux: Check packet_size for validity Reviewed-by: Paul B Mahol Signed-off-by: Michael Niedermayer --- libavformat/iss.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavformat/iss.c b/libavformat/iss.c index 2bae3c1d7b..bbc8465b35 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);