Commit 5eb2bf25 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Also handle fork() failure in magick_load_image

parent 8f5a8424
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@ git HEAD

    * Fix crash when trying to rotate a JPEG image without having
      jpegtran / jpegexiforient installed
    * Handle failing fork() calls gracefully

Thu, 09 Jun 2016 08:59:35 +0200  Daniel Friesel <derf+feh@finalrewind.org>

+7 −1
Original line number Diff line number Diff line
@@ -312,7 +312,13 @@ static char *feh_magick_load_image(char *filename)

	snprintf(argv_fd, sizeof(argv_fd), "png:fd:%d", fd);

	if ((childpid = fork()) == 0) {
	if ((childpid = fork()) < 0) {
		weprintf("%s: Can't load with imagemagick. Fork failed:", filename);
		unlink(sfn);
		free(sfn);
		sfn = NULL;
	}
	else if (childpid == 0) {

		/* discard convert output */
		devnull = open("/dev/null", O_WRONLY);