Browse code

issdemux: Check packet_size for validity

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2011/12/29 13:05:52
Showing 1 changed files
... ...
@@ -87,6 +87,11 @@ static av_cold int iss_read_header(AVFormatContext *s, AVFormatParameters *ap)
87 87
     get_token(pb, token, sizeof(token)); //Version ID
88 88
     get_token(pb, token, sizeof(token)); //Size
89 89
 
90
+    if (iss->packet_size <= 0) {
91
+        av_log(s, AV_LOG_ERROR, "packet_size %d is invalid\n", iss->packet_size);
92
+        return AVERROR_INVALIDDATA;
93
+    }
94
+
90 95
     iss->sample_start_pos = avio_tell(pb);
91 96
 
92 97
     st = avformat_new_stream(s, NULL);