Fix CID 1457235.
Unified · Split
| @@ -170,6 +170,7 @@ int av_buffer_realloc(AVBufferRef **pbuf, int size) · 169 unmodified lines | ||
| 170 | 170 | { |
| 171 | 171 | AVBufferRef *buf = *pbuf; |
| 172 | 172 | uint8_t *tmp; |
| 173 | + int ret; | |
| 173 | 174 | |
| 174 | 175 | if (!buf) { |
| 175 | 176 | /* 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 | 197 | /* cannot realloc, allocate a new reallocable buffer and copy data */ |
| 197 | 198 | AVBufferRef *new = NULL; |
| 198 | 199 | |
| 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; | |
| 202 | 203 | |
| 203 | 204 | memcpy(new->data, buf->data, FFMIN(size, buf->size)); |
| 204 | 205 | |