avformat/flvenc: Fix leak of oversized packets

Might happen for annex B H.264.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
pull/331/head
Andreas Rheinhardt 5 years ago committed by Michael Niedermayer
parent 28d02524a0
commit b0d0d7e4d0
  1. 3
      libavformat/flvenc.c

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

Loading…
Cancel
Save