~ubuntu-branches/ubuntu/intrepid/libgd2/intrepid-security

« back to all changes in this revision

Viewing changes to tests/jpeg/jpeg_read.c

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2007-12-06 17:02:21 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20071206170221-0h9h2222a7lzrnj1
Tags: 2.0.35.dfsg-3ubuntu1
* Merge from debian unstable, remaining changes:
  - debian/control: Drop unnecessary build dependency 'gnulib'.
  - maintainer field updates

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: jpeg_read.c,v 1.1 2007/01/23 23:57:54 pajoye Exp $ */
 
1
/* $Id: jpeg_read.c,v 1.1.2.2 2007/04/10 20:32:37 pajoye Exp $ */
2
2
#include "gd.h"
3
3
#include <stdio.h>
4
4
#include <stdlib.h>
9
9
        int error;
10
10
        gdImagePtr im;
11
11
        FILE *fp;
 
12
        char path[1024];
12
13
 
13
 
        fp = fopen("conv_test.jpeg", "rb");
 
14
        sprintf(path, "%s/jpeg/conv_test.jpeg", GDTEST_TOP_DIR);
 
15
        fp = fopen(path, "rb");
14
16
        if (!fp) {
15
17
                printf("failed, cannot open file\n");
16
18
                return 1;
19
21
        im = gdImageCreateFromJpeg(fp);
20
22
        fclose(fp);
21
23
 
22
 
        if (!gdAssertImageEqualsToFile("conv_test_exp.png", im)) {
 
24
        sprintf(path, "%s/jpeg/conv_test_exp.png", GDTEST_TOP_DIR);
 
25
        if (!gdAssertImageEqualsToFile(path, im)) {
23
26
                error = 1;
24
27
        } else {
25
28
                if (im) {