OSDN Git Service

avcodec_encode_audio2: add missing padding to realloc()
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 22 Mar 2012 01:17:32 +0000 (02:17 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 22 Mar 2012 18:03:17 +0000 (19:03 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/utils.c

index e61ace6..b5570aa 100644 (file)
@@ -1071,7 +1071,7 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
     }
     if (!ret) {
         if (!user_packet && avpkt->data) {
-            uint8_t *new_data = av_realloc(avpkt->data, avpkt->size);
+            uint8_t *new_data = av_realloc(avpkt->data, avpkt->size + FF_INPUT_BUFFER_PADDING_SIZE);
             if (new_data)
                 avpkt->data = new_data;
         }