summaryrefslogtreecommitdiff
path: root/libavutil/buffer.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-01-15 00:42:55 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-03-12 02:15:28 +0100
commit26d81b5703ea3b100d5138c0a6359076de2a1e0d (patch)
tree927a5b63ac4b522dfe9dbf3c6b0005e5082a0614 /libavutil/buffer.c
parent35fad1e9c90b329b8680787ee5a00c74223c6029 (diff)
downloadffmpeg-26d81b5703ea3b100d5138c0a6359076de2a1e0d.tar.gz
avutil/buffer: Avoid moving the AVBufferRef to a new place in memory in av_buffer_make_writable()
This allows making a AVBufferRef writable 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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavutil/buffer.c b/libavutil/buffer.c
index b31f0343b3..bb112c238e 100644
--- a/libavutil/buffer.c
+++ b/libavutil/buffer.c
@@ -159,8 +159,8 @@ int av_buffer_make_writable(AVBufferRef **pbuf)
return AVERROR(ENOMEM);
memcpy(newbuf->data, buf->data, buf->size);
- av_buffer_unref(pbuf);
- *pbuf = newbuf;
+
+ buffer_replace(pbuf, &newbuf);
return 0;
}