Check for invalid packet size in the smacker demuxer.
authorLaurent Aimar <fenrir@videolan.org>
Mon, 12 Sep 2011 18:50:13 +0000 (20:50 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 3 Nov 2011 02:27:16 +0000 (03:27 +0100)
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit e055932f5636a82275837968eea9c8fcb5bca474)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavformat/smacker.c

index 8ec28bc..fa4f631 100644 (file)
@@ -292,6 +292,8 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt)
             }
             flags >>= 1;
         }
+        if (frame_size < 0)
+            return AVERROR_INVALIDDATA;
         if (av_new_packet(pkt, frame_size + 768))
             return AVERROR(ENOMEM);
         if(smk->frm_size[smk->cur_frame] & 1)