lavu/buffer: forward av_buffer_realloc() error code.

Fix CID 1457235.
This commit is contained in:
Nicolas George 2020-01-04 19:52:08 +01:00
parent 06f2651204
commit 2b71cd3e0b

View File

@ -170,6 +170,7 @@ int av_buffer_realloc(AVBufferRef **pbuf, int size)
{
AVBufferRef *buf = *pbuf;
uint8_t *tmp;
int ret;
if (!buf) {
/* allocate a new buffer with av_realloc(), so it will be reallocatable
@ -196,9 +197,9 @@ int av_buffer_realloc(AVBufferRef **pbuf, int size)
/* cannot realloc, allocate a new reallocable buffer and copy data */
AVBufferRef *new = NULL;
av_buffer_realloc(&new, size);
if (!new)
return AVERROR(ENOMEM);
ret = av_buffer_realloc(&new, size);
if (ret < 0)
return ret;
memcpy(new->data, buf->data, FFMIN(size, buf->size));