]> git.sesse.net Git - ffmpeg/commitdiff
avformat/flvenc: Fix leak of oversized packets
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Thu, 26 Dec 2019 10:53:35 +0000 (11:53 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 26 Dec 2019 21:48:44 +0000 (22:48 +0100)
Might happen for annex B H.264.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/flvenc.c

index f6379cbe0580eb03299e80267c2e59a9041fc409..1aaf0333caf50d23c17df37ee85f89a8c55afa89 100644 (file)
@@ -992,7 +992,8 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
     if (size + flags_size >= 1<<24) {
         av_log(s, AV_LOG_ERROR, "Too large packet with size %u >= %u\n",
                size + flags_size, 1<<24);
-        return AVERROR(EINVAL);
+        ret = AVERROR(EINVAL);
+        goto fail;
     }
 
     avio_wb24(pb, size + flags_size);