Commit d8ecb335 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/flvenc: Check audio packet size

Fixes: Assertion failure
Fixes: assert_flvenc.c:941_1.swf
Found-by: 's avatar#CHEN HONGXU# <HCHEN017@e.ntu.edu.sg>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 6b67d7f0)
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 6f84b1c4
...@@ -514,6 +514,11 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -514,6 +514,11 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
uint8_t *data = NULL; uint8_t *data = NULL;
int flags = -1, flags_size, ret; int flags = -1, flags_size, ret;
if (enc->codec_type == AVMEDIA_TYPE_AUDIO && !pkt->size) {
av_log(s, AV_LOG_WARNING, "Empty audio Packet\n");
return AVERROR(EINVAL);
}
if (enc->codec_id == AV_CODEC_ID_VP6F || enc->codec_id == AV_CODEC_ID_VP6A || if (enc->codec_id == AV_CODEC_ID_VP6F || enc->codec_id == AV_CODEC_ID_VP6A ||
enc->codec_id == AV_CODEC_ID_VP6 || enc->codec_id == AV_CODEC_ID_AAC) enc->codec_id == AV_CODEC_ID_VP6 || enc->codec_id == AV_CODEC_ID_AAC)
flags_size = 2; flags_size = 2;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment