소스 검색

Fix handling of zero sized image in img2txt

Fixes https://github.com/cacalabs/libcaca/issues/65
pull/81/merge
Pascal Terjan 5 달 전
부모
커밋
3b3a90112e
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. +7
    -0
      src/img2txt.c

+ 7
- 0
src/img2txt.c 파일 보기

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


불러오는 중...
취소
저장