mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-26 19:01:44 +02:00
avcodec/aac_adtstoasc: fix ASC passthrough on small frames
ASC frames smaller than AAC_ADTS_HEADER_SIZE were being discarded. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
88612f8db3
commit
0f05f2c7e6
@ -49,14 +49,14 @@ static int aac_adtstoasc_filter(AVBSFContext *bsfc, AVPacket *out)
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (bsfc->par_in->extradata && in->size >= 2 && (AV_RB16(in->data) >> 4) != 0xfff)
|
||||
goto finish;
|
||||
|
||||
if (in->size < AAC_ADTS_HEADER_SIZE)
|
||||
goto packet_too_small;
|
||||
|
||||
init_get_bits(&gb, in->data, AAC_ADTS_HEADER_SIZE * 8);
|
||||
|
||||
if (bsfc->par_in->extradata && show_bits(&gb, 12) != 0xfff)
|
||||
goto finish;
|
||||
|
||||
if (avpriv_aac_parse_header(&gb, &hdr) < 0) {
|
||||
av_log(bsfc, AV_LOG_ERROR, "Error parsing ADTS frame header!\n");
|
||||
ret = AVERROR_INVALIDDATA;
|
||||
|
Loading…
Reference in New Issue
Block a user