Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:GA
libcaca.25977
bsc1197028-correctly-handle-zero-width-or-heigh...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bsc1197028-correctly-handle-zero-width-or-height-images.patch of Package libcaca.25977
Index: libcaca-da28e9684ef445ac8d42745644336b8a75c01855/src/img2txt.c =================================================================== --- libcaca-da28e9684ef445ac8d42745644336b8a75c01855.orig/src/img2txt.c +++ libcaca-da28e9684ef445ac8d42745644336b8a75c01855/src/img2txt.c @@ -177,7 +177,13 @@ int main(int argc, char **argv) } /* Assume a 6×10 font */ - if(!cols && !lines) + if(!i->w || !i->h) + { + fprintf(stderr, "%s: image size is 0\n", argv[0]); + lines = 0; + cols = 0; + } + else if(!cols && !lines) { cols = 60; lines = cols * i->h * font_width / i->w / font_height; @@ -214,7 +220,7 @@ int main(int argc, char **argv) export = caca_export_canvas_to_memory(cv, format?format:"ansi", &len); if(!export) { - fprintf(stderr, "%s: Can't export to format '%s'\n", argv[0], format); + fprintf(stderr, "%s: Can't export to format '%s'\n", argv[0], format?format:"ansi"); } else {
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor