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>
pull/125/head
Michael Niedermayer 10 years ago
parent 35fad1e9c9
commit 26d81b5703
  1. 4
      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;
}

Loading…
Cancel
Save