Unverified Commit 87d9b7ed authored by Birte Kristina Friesel's avatar Birte Kristina Friesel Committed by GitHub
Browse files

Merge pull request #615 from DavidBuchanan314/master

Fix feh_is_image for tiny (<16 byte) image files
parents bc372c8f 0e4592a5
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -253,7 +253,9 @@ int feh_is_image(feh_file * file)
	if (!fh) {
		return 0;
	}
	if (fread(buf, 1, 16, fh) != 16) {
	// Files smaller than buf will be padded with zeroes
	memset(buf, 0, sizeof(buf));
	if (fread(buf, 1, 16, fh) <= 0) {
		fclose(fh);
		return 0;
	}
+5 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
use strict;
use warnings;
use 5.010;
use Test::Command tests => 71;
use Test::Command tests => 73;

$ENV{HOME} = 'test';

@@ -186,3 +186,7 @@ $cmd
$cmd->exit_is_num(0);
$cmd->stdout_is_file("test/${list_dir}/default");
$cmd->stderr_is_eq('');

$cmd = Test::Command->new( cmd => "$feh --list test/tiny.pbm" );
$cmd->exit_is_num(0);
$cmd->stderr_is_eq('');

test/tiny.pbm

0 → 100644
+4 −0
Original line number Diff line number Diff line
P4
1 1