Explorar el Código

Fix handling of zero sized image in img2txt

Fixes https://github.com/cacalabs/libcaca/issues/65
main
Pascal Terjan hace 4 meses
padre
commit
3b3a90112e
Se han modificado 1 ficheros con 7 adiciones y 0 borrados
  1. +7
    -0
      src/img2txt.c

+ 7
- 0
src/img2txt.c Ver fichero

@@ -176,6 +176,13 @@ int main(int argc, char **argv)
return 1;
}

if(!i->w || !i->h)
{
fprintf(stderr, "%s: image %s has invalid dimensions %ldx%ld\n", argv[0], argv[argc-1], i->w, i->h);
caca_free_canvas(cv);
return 1;
}

/* Assume a 6×10 font */
if(!cols && !lines)
{


Cargando…
Cancelar
Guardar