diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-01-15 00:42:55 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-03-12 02:15:28 +0100 |
commit | 35fad1e9c90b329b8680787ee5a00c74223c6029 (patch) | |
tree | 3eec6459454947a3f9ddf09d6a9646c807fd576d | |
parent | 3bedc99723a3684260441218a6f5bf42e147db12 (diff) | |
download | ffmpeg-35fad1e9c90b329b8680787ee5a00c74223c6029.tar.gz |
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>
-rw-r--r-- | libavutil/buffer.c | 3 |
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; } |