Skip to content
Snippets Groups Projects
Commit 6e1902ba authored by James Almer's avatar James Almer
Browse files

avcodec/aac_adtstoasc_bsf: validate and forward extradata if the stream is already ASC


Fixes ticket #5973

Reviewed-by: default avatarHendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: default avatarJames Almer <jamrial@gmail.com>
parent 2566ad98
No related branches found
No related tags found
No related merge requests found
......@@ -136,8 +136,16 @@ fail:
static int aac_adtstoasc_init(AVBSFContext *ctx)
{
av_freep(&ctx->par_out->extradata);
ctx->par_out->extradata_size = 0;
/* Validate the extradata if the stream is already MPEG-4 AudioSpecificConfig */
if (ctx->par_in->extradata) {
MPEG4AudioConfig mp4ac;
int ret = avpriv_mpeg4audio_get_config(&mp4ac, ctx->par_in->extradata,
ctx->par_in->extradata_size * 8, 1);
if (ret < 0) {
av_log(ctx, AV_LOG_ERROR, "Error parsing AudioSpecificConfig extradata!\n");
return ret;
}
}
return 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment