Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-01-15 02:42:55 +0300
committerMichael Niedermayer <michaelni@gmx.at>2015-03-12 04:15:28 +0300
commit35fad1e9c90b329b8680787ee5a00c74223c6029 (patch)
tree3eec6459454947a3f9ddf09d6a9646c807fd576d /libavutil/buffer.c
parent3bedc99723a3684260441218a6f5bf42e147db12 (diff)
avutil/buffer: Avoid moving the AVBufferRef to a new place in memory in av_buffer_realloc()
This allows reallocating AVBufferRefs without the need to update all pointers to it Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/buffer.c')
-rw-r--r--libavutil/buffer.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavutil/buffer.c b/libavutil/buffer.c
index ca102fd574..b31f0343b3 100644
--- a/libavutil/buffer.c
+++ b/libavutil/buffer.c
@@ -201,8 +201,7 @@ int av_buffer_realloc(AVBufferRef **pbuf, int size)
memcpy(new->data, buf->data, FFMIN(size, buf->size));
- av_buffer_unref(pbuf);
- *pbuf = new;
+ buffer_replace(pbuf, &new);
return 0;
}