mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-17 20:17:55 +02:00
avformat/aacdec: resync to the next adts frame on invalid data instead of aborting
Should fix ticket #6634 Signed-off-by: James Almer <jamrial@gmail.com> (cherry picked from commit 881e1f5a6227a6fbaf67083d4d4b6caf58ff9892)
This commit is contained in:
parent
a9282fc964
commit
bb22b9ce21
@ -133,6 +133,7 @@ static int adts_aac_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
{
|
||||
int ret, fsize;
|
||||
|
||||
retry:
|
||||
ret = av_get_packet(s->pb, pkt, ADTS_HEADER_SIZE);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
@ -143,7 +144,10 @@ static int adts_aac_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
|
||||
if ((AV_RB16(pkt->data) >> 4) != 0xfff) {
|
||||
av_packet_unref(pkt);
|
||||
return AVERROR_INVALIDDATA;
|
||||
ret = adts_aac_resync(s);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
goto retry;
|
||||
}
|
||||
|
||||
fsize = (AV_RB32(pkt->data + 3) >> 13) & 0x1FFF;
|
||||
|
Loading…
x
Reference in New Issue
Block a user