mirror of https://git.ffmpeg.org/ffmpeg.git
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>
This commit is contained in:
parent
3bedc99723
commit
35fad1e9c9
|
@ -201,8 +201,7 @@ int av_buffer_realloc(AVBufferRef **pbuf, int size)
|
||||||
|
|
||||||
memcpy(new->data, buf->data, FFMIN(size, buf->size));
|
memcpy(new->data, buf->data, FFMIN(size, buf->size));
|
||||||
|
|
||||||
av_buffer_unref(pbuf);
|
buffer_replace(pbuf, &new);
|
||||||
*pbuf = new;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue