History

lavu/buffer: forward av_buffer_realloc() error code.

Fix CID 1457235.

Nicolas George committed 6 years ago

Commit 2b71cd31 parent 06f26511 file · +4 −3Browse files

Unified · Split

libavutil/buffer.c+4−3
@@ -170,6 +170,7 @@ int av_buffer_realloc(AVBufferRef **pbuf, int size) · 169 unmodified lines
170{170{
171 AVBufferRef *buf = *pbuf;171 AVBufferRef *buf = *pbuf;
172 uint8_t *tmp;172 uint8_t *tmp;
173 int ret;
173 174
174 if (!buf) {175 if (!buf) {
175 /* allocate a new buffer with av_realloc(), so it will be reallocatable176 /* allocate a new buffer with av_realloc(), so it will be reallocatable
@@ -196,9 +197,9 @@ int av_buffer_realloc(AVBufferRef **pbuf, int size) · 20 unmodified lines
196 /* cannot realloc, allocate a new reallocable buffer and copy data */197 /* cannot realloc, allocate a new reallocable buffer and copy data */
197 AVBufferRef *new = NULL;198 AVBufferRef *new = NULL;
198 199
199 av_buffer_realloc(&new, size);200 ret = av_buffer_realloc(&new, size);
200 if (!new)201 if (ret < 0)
201 return AVERROR(ENOMEM);202 return ret;
202 203
203 memcpy(new->data, buf->data, FFMIN(size, buf->size));204 memcpy(new->data, buf->data, FFMIN(size, buf->size));
204 205

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t