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>
This commit is contained in:
Michael Niedermayer 2015-01-15 00:42:55 +01:00
parent 35fad1e9c9
commit 26d81b5703

View File

@ -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;
}