aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2012-03-03 10:35:36 +0100
committerNicolas George <nicolas.george@normalesup.org>2012-03-03 15:56:45 +0100
commitb2792a436b0c25849481a4a40cd4157744b59d87 (patch)
treec49152764316371342c3863fe90e8f8f34104a50 /libavcodec
parent07fb7682d193c5792ec32f1e7574f28249f6e261 (diff)
downloadffmpeg-b2792a436b0c25849481a4a40cd4157744b59d87.tar.gz
lavc: unify similar code merged from both branches.
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/utils.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 2b6e30e5bf..f462bd1a73 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1219,15 +1219,10 @@ 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 && avpkt->destruct == av_destruct_packet) {
- new_data = av_realloc(avpkt->data,
- avpkt->size + FF_INPUT_BUFFER_PADDING_SIZE);
- if (new_data)
- avpkt->data = new_data;
- }
- if (!user_packet && avpkt->data) {
- uint8_t *new_data = av_realloc(avpkt->data, avpkt->size);
+ if (!user_packet && avpkt->data &&
+ avpkt->destruct == av_destruct_packet) {
+ uint8_t *new_data = av_realloc(avpkt->data, avpkt->size + FF_INPUT_BUFFER_PADDING_SIZE);
if (new_data)
avpkt->data = new_data;
}