dsicin: Add some basic sanity checks for fields read from the file
authorMartin Storsjö <martin@martin.st>
Wed, 11 Sep 2013 12:13:48 +0000 (15:13 +0300)
committerMartin Storsjö <martin@martin.st>
Wed, 11 Sep 2013 17:18:55 +0000 (20:18 +0300)
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/dsicin.c

index ecc8c0b..6a7c8b9 100644 (file)
@@ -154,6 +154,8 @@ static int cin_read_frame_header(CinDemuxContext *cin, AVIOContext *pb) {
 
     if (avio_rl32(pb) != 0xAA55AA55)
         return AVERROR_INVALIDDATA;
+    if (hdr->video_frame_size < 0 || hdr->audio_frame_size < 0)
+        return AVERROR_INVALIDDATA;
 
     return 0;
 }