From 2b71cd3e0b1a545df670f0d057655e0b59b98f5f Mon Sep 17 00:00:00 2001 From: Nicolas George Date: Sat, 4 Jan 2020 19:52:08 +0100 Subject: lavu/buffer: forward av_buffer_realloc() error code. Fix CID 1457235. --- libavutil/buffer.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libavutil/buffer.c') diff --git a/libavutil/buffer.c b/libavutil/buffer.c index 38a554208a..08e6079139 100644 --- a/libavutil/buffer.c +++ b/libavutil/buffer.c @@ -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)); -- cgit v1.2.3