Skip to content

Commit 6b67d7f

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>
1 parent 476fd6b commit 6b67d7f

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
@@ -883,6 +883,11 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
883883
int flags = -1, flags_size, ret;
884884
int64_t cur_offset = avio_tell(pb);
885885

886+
if (par->codec_type == AVMEDIA_TYPE_AUDIO && !pkt->size) {
887+
av_log(s, AV_LOG_WARNING, "Empty audio Packet\n");
888+
return AVERROR(EINVAL);
889+
}
890+
886891
if (par->codec_id == AV_CODEC_ID_VP6F || par->codec_id == AV_CODEC_ID_VP6A ||
887892
par->codec_id == AV_CODEC_ID_VP6 || par->codec_id == AV_CODEC_ID_AAC)
888893
flags_size = 2;

0 commit comments

Comments
 (0)