mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-27 09:11:17 +00:00
buffer: fix av_buffer_realloc() when the data is offset wrt buffer start
In such a case behave as if the buffer was not reallocatable -- allocate a new one and copy the data (preserving just the part described by the reference passed to av_buffer_realloc). CC: libav-stable@libav.org Reported-By: wm4 <nfxjfg@googlemail.com>
This commit is contained in:
parent
e99ecda550
commit
24a362569b
@ -170,7 +170,7 @@ int av_buffer_realloc(AVBufferRef **pbuf, int size)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (!(buf->buffer->flags & BUFFER_FLAG_REALLOCATABLE) ||
|
if (!(buf->buffer->flags & BUFFER_FLAG_REALLOCATABLE) ||
|
||||||
!av_buffer_is_writable(buf)) {
|
!av_buffer_is_writable(buf) || buf->data != buf->buffer->data) {
|
||||||
/* cannot realloc, allocate a new reallocable buffer and copy data */
|
/* cannot realloc, allocate a new reallocable buffer and copy data */
|
||||||
AVBufferRef *new = NULL;
|
AVBufferRef *new = NULL;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user