mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
avcodec/utils: do not use internal->byte_buffer when little downsizing is expected
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
0dbfb5386f
commit
9fe873bec8
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user