Kaynağa Gözat

Fix handling of zero sized image in img2txt

Fixes https://github.com/cacalabs/libcaca/issues/65
main
Pascal Terjan 4 ay önce
ebeveyn
işleme
3b3a90112e
1 değiştirilmiş dosya ile 7 ekleme ve 0 silme
  1. +7
    -0
      src/img2txt.c

+ 7
- 0
src/img2txt.c Dosyayı Görüntüle

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


Yükleniyor…
İptal
Kaydet