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;
|
int ret, fsize;
|
||||||
|
|
||||||
|
retry:
|
||||||
ret = av_get_packet(s->pb, pkt, ADTS_HEADER_SIZE);
|
ret = av_get_packet(s->pb, pkt, ADTS_HEADER_SIZE);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
@ -143,7 +144,10 @@ static int adts_aac_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
|
|
||||||
if ((AV_RB16(pkt->data) >> 4) != 0xfff) {
|
if ((AV_RB16(pkt->data) >> 4) != 0xfff) {
|
||||||
av_packet_unref(pkt);
|
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;
|
fsize = (AV_RB32(pkt->data + 3) >> 13) & 0x1FFF;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user