avformat/movenc: handle OOM situations when parsing AC-3 headers

Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
release/5.1
Jan Ekström 3 years ago committed by Jan Ekström
parent 3854c58d9e
commit c9de096851
  1. 5
      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");

Loading…
Cancel
Save