diff mbox

[FFmpeg-devel,10/17] avformat/flvenc: Fix leak of oversized packets

Message ID 20191226105342.11175-10-andreas.rheinhardt@gmail.com
State Accepted
Headers show

Commit Message

Andreas Rheinhardt Dec. 26, 2019, 10:53 a.m. UTC
Might happen for annex B H.264.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
No change since last time.

 libavformat/flvenc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Michael Niedermayer Dec. 26, 2019, 9:53 p.m. UTC | #1
On Thu, Dec 26, 2019 at 11:53:35AM +0100, Andreas Rheinhardt wrote:
> Might happen for annex B H.264.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
> No change since last time.

will apply

thx

[...]
diff mbox

Patch

diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index f6379cbe05..1aaf0333ca 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -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);