Message ID | 20220630064238.45315-7-jeebjp@gmail.com |
---|---|
State | New |
Headers | show |
Series | avformat/movenc: normalize on AC-3 parser usage | expand |
Context | Check | Description |
---|---|---|
yinshiyou/make_loongarch64 | success | Make finished |
yinshiyou/make_fate_loongarch64 | success | Make fate finished |
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 382c2f2e75..022fab675e 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -416,7 +416,10 @@ static int handle_eac3(MOVMuxContext *mov, AVPacket *pkt, MOVTrack *track) if (!info->pkt && !(info->pkt = av_packet_alloc())) return AVERROR(ENOMEM); - if (avpriv_ac3_parse_header(&hdr, pkt->data, pkt->size) < 0) { + if ((ret = avpriv_ac3_parse_header(&hdr, pkt->data, pkt->size) < 0)) { + if (ret == AVERROR(ENOMEM)) + goto end; + /* drop the packets until we see a good one */ if (!track->entry) { av_log(mov->fc, AV_LOG_WARNING, "Dropping invalid packet from start of the stream\n");