---
 libavcodec/aacdec.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index 4d3f1ff..54507b4 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -2259,7 +2259,9 @@ static int aac_decode_frame(AVCodecContext *avctx, void 
*data,
                                        AV_PKT_DATA_NEW_EXTRADATA,
                                        &new_extradata_size);
 
-    if (new_extradata) {
+    if (new_extradata &&
+        (!avctx->extradata || new_extradata_size != avctx->extradata_size ||
+         memcmp(new_extradata, avctx->extradata, new_extradata_size))) {
         av_free(avctx->extradata);
         avctx->extradata = av_mallocz(new_extradata_size +
                                       FF_INPUT_BUFFER_PADDING_SIZE);
-- 
1.7.3.1

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to