Commit 9fe873be authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/utils: do not use internal->byte_buffer when little downsizing is expected

Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 0dbfb538
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment