summaryrefslogtreecommitdiff
path: root/Build/source/libs/gd/libgd-src/tests/png/bug00011.c
blob: 865c87ea5cd1d60e061b4374b27452f12f15ee70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* $Id$ */
#include "gd.h"
#include <stdio.h>
#include <stdlib.h>
#include "gdtest.h"

int main()
{
	gdImagePtr im;
	FILE *fp;
	char path[2048];

	sprintf(path, "%s/png/emptyfile", GDTEST_TOP_DIR);
	fp = fopen(path, "rb");
	if (!fp) {
		fprintf(stderr, "failed, cannot open file: %s\n", path);
		return 1;
	}
	im = gdImageCreateFromPng(fp);
	fclose(fp);

	if (!im) {
		return 0;
	} else {
		return 1;
	}
}