Skip to content

Commit 4c9d26b

Browse files
committed
todo investigate
1 parent d156bb6 commit 4c9d26b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Image.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,8 @@ Image::SetSource(const Napi::CallbackInfo& info){
263263

264264
cairo_status_t
265265
Image::loadFromBuffer(uint8_t *buf, unsigned len) {
266+
if (len == 0) return CAIRO_STATUS_READ_ERROR;
267+
266268
uint8_t data[4] = {0};
267269
memcpy(data, buf, (len < 4 ? len : 4) * sizeof(uint8_t));
268270

0 commit comments

Comments
 (0)