Skip to content

Commit d8ecb33

Browse files
committed
avformat/flvenc: Check audio packet size
Fixes: Assertion failure Fixes: assert_flvenc.c:941_1.swf Found-by: #CHEN HONGXU# <HCHEN017@e.ntu.edu.sg> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 6b67d7f) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
1 parent 6f84b1c commit d8ecb33

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: libavformat/flvenc.c

+5
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,11 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
514514
uint8_t *data = NULL;
515515
int flags = -1, flags_size, ret;
516516

517+
if (enc->codec_type == AVMEDIA_TYPE_AUDIO && !pkt->size) {
518+
av_log(s, AV_LOG_WARNING, "Empty audio Packet\n");
519+
return AVERROR(EINVAL);
520+
}
521+
517522
if (enc->codec_id == AV_CODEC_ID_VP6F || enc->codec_id == AV_CODEC_ID_VP6A ||
518523
enc->codec_id == AV_CODEC_ID_VP6 || enc->codec_id == AV_CODEC_ID_AAC)
519524
flags_size = 2;

0 commit comments

Comments
 (0)