Skip to content

Commit f820073

Browse files
committed
Check if the image generation function fails
1 parent ae5189f commit f820073

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ int main(int argc, char** argv) {
5555

5656
/* Convert the ByteArray to a color Image depending on the global mode */
5757
Image* image = generation_func(&args, &file_bytes);
58+
if (image == NULL)
59+
DIE("Failed to generate image.");
5860

5961
/* We are done with the initial file bytes, free them */
6062
byte_array_destroy(&file_bytes);

0 commit comments

Comments
 (0)