Fix CID 1457235.
Unified · Split
| @@ -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 reallocatable | 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 | /* 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 | ||