diff options
author | James Almer <jamrial@gmail.com> | 2017-05-24 23:37:04 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2017-05-25 01:26:02 -0300 |
commit | 954e2b3d34b7c2d82871254f07e2f8a39bc451cb (patch) | |
tree | 32586d98ff58242bb07b583e35a05ddf84ac2629 /libavcodec | |
parent | 8ea5ee10a2d6e67676a5c47ea78294a8623c5b2e (diff) | |
download | ffmpeg-954e2b3d34b7c2d82871254f07e2f8a39bc451cb.tar.gz |
avcodec/audiotoolboxdec: check packet side data for AAC extradata updates
Tested-by: rcombs
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/audiotoolboxdec.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/libavcodec/audiotoolboxdec.c b/libavcodec/audiotoolboxdec.c index 04a9be9fcb..a8655f0421 100644 --- a/libavcodec/audiotoolboxdec.c +++ b/libavcodec/audiotoolboxdec.c @@ -504,8 +504,20 @@ static int ffat_decode(AVCodecContext *avctx, void *data, if ((ret = av_bsf_receive_packet(at->bsf, &filtered_packet)) < 0) return ret; - at->extradata = at->bsf->par_out->extradata; - at->extradata_size = at->bsf->par_out->extradata_size; + if (!at->extradata_size) { + uint8_t *side_data; + int side_data_size = 0; + + side_data = av_packet_get_side_data(&filtered_packet, AV_PKT_DATA_NEW_EXTRADATA, + &side_data_size); + if (side_data_size) { + at->extradata = av_mallocz(side_data_size + AV_INPUT_BUFFER_PADDING_SIZE); + if (!at->extradata) + return AVERROR(ENOMEM); + at->extradata_size = side_data_size; + memcpy(at->extradata, side_data, side_data_size); + } + } avpkt = &filtered_packet; } |