sprixel_auxiliary_vector: don't deref NULL on alloc failure

pull/1825/head
nick black 3 years ago
parent 9395245b31
commit 4064ede06c
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -213,6 +213,8 @@ uint8_t* sprixel_auxiliary_vector(const sprixel* s){
// for now we just do two bytes per pixel. we ought squeeze the transparency
// vector down to a bit per pixel, rather than a byte FIXME.
uint8_t* ret = malloc(sizeof(*ret) * pixels * 2);
memset(ret, 0, sizeof(*ret) * pixels);
if(ret){
memset(ret, 0, sizeof(*ret) * pixels);
}
return ret;
}

Loading…
Cancel
Save