summaryrefslogtreecommitdiff
path: root/Build/source/libs/gd/libgd-src/tests/gd2/bug00209.c
blob: 4379d389ccc943f86e1d7cabdd532c398c91ca72 (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
28
/**
 * Regression test for github issue #209
 *
 * We're testing that bug00209.gd2, which claims to have 12336 x 48 pixels, but
 * actually provides not enough image data, is rejected, i.e. that
 * gdImageCreateFromGd2() returns NULL
 *
 * See <https://github.com/libgd/libgd/issues/209>.
 */


#include "gd.h"
#include "gdtest.h"


int main()
{
    gdImagePtr im;
    FILE *fp;

    fp = gdTestFileOpen2("gd2", "bug00209.gd2");
    gdTestAssert(fp != NULL);
    im = gdImageCreateFromGd2(fp);
    gdTestAssert(im == NULL);
    fclose(fp);

    return gdNumFailures();
}