mirror of https://git.ffmpeg.org/ffmpeg.git
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;
|
||||
|
||||
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 */
|
||||
AVBufferRef *new = NULL;
|
||||
|
||||
|
|
Loading…
Reference in New Issue