mirror of
https://git.familie-radermacher.ch/linux/ptouch-print.git
synced 2025-05-15 00:02:56 +00:00
prevent segfault when image fails to load
This commit is contained in:
parent
98541a6f61
commit
badc152127
@ -491,7 +491,10 @@ int main(int argc, char *argv[])
|
|||||||
printf("error = %04x\n", ptdev->status->error);
|
printf("error = %04x\n", ptdev->status->error);
|
||||||
exit(0);
|
exit(0);
|
||||||
} else if (strcmp(&argv[i][1], "-image") == 0) {
|
} else if (strcmp(&argv[i][1], "-image") == 0) {
|
||||||
im=image_load(argv[++i]);
|
if ((im=image_load(argv[++i])) == NULL) {
|
||||||
|
printf(_("failed to load image file\n"));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
out=img_append(out, im);
|
out=img_append(out, im);
|
||||||
gdImageDestroy(im);
|
gdImageDestroy(im);
|
||||||
im = NULL;
|
im = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user