avformat/swfdec: Fix memleak on error
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 21 Aug 2016 23:01:44 +0000 (01:01 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 21 Aug 2016 23:29:51 +0000 (01:29 +0200)
Fixes: 9eb9cf5b8c26dd0fa7107ed0348dcc1f/signal_sigabrt_7ffff6ae7c37_8925_1f676b5229d009f2b56dfd9e149fa6ba.swf

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/swfdec.c

index 20f1568..3268c0a 100644 (file)
@@ -397,6 +397,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
 
             if (linesize * height > pkt->size) {
                 res = AVERROR_INVALIDDATA;
+                av_packet_unref(pkt);
                 goto bitmap_end;
             }