lavu/buffer: forward av_buffer_realloc() error code.
Fix CID 1457235.
This commit is contained in:
parent
06f2651204
commit
2b71cd3e0b
@ -170,6 +170,7 @@ int av_buffer_realloc(AVBufferRef **pbuf, int size)
|
|||||||
{
|
{
|
||||||
AVBufferRef *buf = *pbuf;
|
AVBufferRef *buf = *pbuf;
|
||||||
uint8_t *tmp;
|
uint8_t *tmp;
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
/* allocate a new buffer with av_realloc(), so it will be reallocatable
|
/* 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 */
|
/* cannot realloc, allocate a new reallocable buffer and copy data */
|
||||||
AVBufferRef *new = NULL;
|
AVBufferRef *new = NULL;
|
||||||
|
|
||||||
av_buffer_realloc(&new, size);
|
ret = av_buffer_realloc(&new, size);
|
||||||
if (!new)
|
if (ret < 0)
|
||||||
return AVERROR(ENOMEM);
|
return ret;
|
||||||
|
|
||||||
memcpy(new->data, buf->data, FFMIN(size, buf->size));
|
memcpy(new->data, buf->data, FFMIN(size, buf->size));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user