Skip to content
Snippets Groups Projects
Commit 24a36256 authored by Anton Khirnov's avatar Anton Khirnov
Browse files

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: default avatarwm4 <nfxjfg@googlemail.com>
parent e99ecda5
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment