returns 1 if success, 0 if failure ==> nothing done*/
| 268 | |
| 269 | /*returns 1 if success, 0 if failure ==> nothing done*/ |
| 270 | static unsigned ucvector_resize(ucvector* p, size_t size) { |
| 271 | if(size > p->allocsize) { |
| 272 | size_t newsize = size + (p->allocsize >> 1u); |
| 273 | void* data = lodepng_realloc(p->data, newsize); |
| 274 | if(data) { |
| 275 | p->allocsize = newsize; |
| 276 | p->data = (unsigned char*)data; |
| 277 | } |
| 278 | else return 0; /*error: not enough memory*/ |
| 279 | } |
| 280 | p->size = size; |
| 281 | return 1; /*success*/ |
| 282 | } |
| 283 | |
| 284 | static ucvector ucvector_init(unsigned char* buffer, size_t size) { |
| 285 | ucvector v; |
no test coverage detected