Permalink
Browse files

img2txt: reject pictures with 0 bits per plane.

Fixes: #42
  • Loading branch information...
samhocevar committed Jan 1, 2019
1 parent 6425104 commit 813baea7a7bc28986e474541dd1080898fac14d7
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/common-image.c
@@ -153,7 +153,7 @@ struct image * load_image(char const * name)
uint32_t depth = (bpp + 7) / 8;

/* Sanity check */
if (!im->w || im->w > 0x10000 || !im->h || im->h > 0x10000 || planes != 1)
if (!depth || !im->w || im->w > 0x10000 || !im->h || im->h > 0x10000 || planes != 1)
{
caca_file_close(f);
free(im);

0 comments on commit 813baea

Please sign in to comment.