| 163 | } |
| 164 | |
| 165 | int av_buffer_make_writable(AVBufferRef **pbuf) |
| 166 | { |
| 167 | AVBufferRef *newbuf, *buf = *pbuf; |
| 168 | |
| 169 | if (av_buffer_is_writable(buf)) |
| 170 | return 0; |
| 171 | |
| 172 | newbuf = av_buffer_alloc(buf->size); |
| 173 | if (!newbuf) |
| 174 | return AVERROR(ENOMEM); |
| 175 | |
| 176 | memcpy(newbuf->data, buf->data, buf->size); |
| 177 | |
| 178 | buffer_replace(pbuf, &newbuf); |
| 179 | |
| 180 | return 0; |
| 181 | } |
| 182 | |
| 183 | int av_buffer_realloc(AVBufferRef **pbuf, size_t size) |
| 184 | { |
no test coverage detected