summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-07-27 20:01:59 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-07-27 20:03:02 +0200
commit9fe873bec8b6d342064cf282b0ba09f91ac9292f (patch)
tree52215977f9dedb81c98cae1eef9f19db620d4873
parent0dbfb5386f1e27ef148793a4eb47bd9826756f2c (diff)
avcodec/utils: do not use internal->byte_buffer when little downsizing is expected
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index b147559aba..42d509e01a 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1789,7 +1789,7 @@ int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int64
return AVERROR(EINVAL);
}
- if (avctx) {
+ if (avctx && 2*min_size < size) { // FIXME The factor needs to be finetuned
av_assert0(!avpkt->data || avpkt->data != avctx->internal->byte_buffer);
if (!avpkt->data || avpkt->size < size) {
av_fast_padded_malloc(&avctx->internal->byte_buffer, &avctx->internal->byte_buffer_size, size);