aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-02-29 21:33:00 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-02-29 21:33:00 +0100
commita77c8ade2ee20fc6149e4c689a3f196f53e85273 (patch)
tree4075579c2e2aa714bd6fea2a7c11c8370780375c
parentd7bce4a274c4fc7453cde2d1c5d8a7a5805718df (diff)
downloadffmpeg-a77c8ade2ee20fc6149e4c689a3f196f53e85273.tar.gz
lavc: fix 10l oversight in realloc of avcodec_encode_video2.
Packets are not guranteed to be allocated by av_malloc(). Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 99e36f84a8..b612ca1ace 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1219,7 +1219,7 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx,
avpkt->size = 0;
else if (!(avctx->codec->capabilities & CODEC_CAP_DELAY))
avpkt->pts = avpkt->dts = frame->pts;
- if (avpkt->data) {
+ if (avpkt->data && avpkt->destruct == av_destruct_packet) {
new_data = av_realloc(avpkt->data,
avpkt->size + FF_INPUT_BUFFER_PADDING_SIZE);
if (new_data)