Browse Source

img2txt: reject pictures with 0 bits per plane.

Fixes: #42
tags/v0.99.beta20
Sam Hocevar 6 years ago
parent
commit
813baea7a7
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/common-image.c

+ 1
- 1
src/common-image.c View File

@@ -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);


Loading…
Cancel
Save