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
170170 {
171171 AVBufferRef *buf = *pbuf;
172172 uint8_t *tmp;
173+ int ret;
173174
174175 if (!buf) {
175176 /* 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
196197 /* cannot realloc, allocate a new reallocable buffer and copy data */
197198 AVBufferRef *new = NULL;
198199
199− av_buffer_realloc(&new, size);
200− if (!new)
201− return AVERROR(ENOMEM);
200+ ret = av_buffer_realloc(&new, size);
201+ if (ret < 0)
202+ return ret;
202203
203204 memcpy(new->data, buf->data, FFMIN(size, buf->size));
204205

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