~ubuntu-branches/ubuntu/trusty/freeimage/trusty

« back to all changes in this revision

Viewing changes to Source/LibOpenJPEG/image.c

  • Committer: Package Import Robot
  • Author(s): Evan Broder, Evan Broder, Stefano Rivera
  • Date: 2011-12-06 14:31:21 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20111206143121-1d1honlf3ixuk6lw
Tags: 3.15.1-1
[ Evan Broder ]
* QA upload.
* New upstream release (closes: 649541, LP: #898825, #898845)
  - Refreshed patches.
    + Abuse dh-autoreconf to generate Makefile.srcs and fipMakefile.srcs
      patches at build time
  - Update debian/freeimage-get-orig-source for the new version.
  - Add new build-dep libraw-dev.
  - Update patch to disable embedded libraries to deal with API changes
    in libpng, libmng, and libraw.
  - Make sure we install symlinks for libfreeimageplus.
  - Use (upstream-supported) CFLAGS instead of COMPILERFLAGS.
* Switch to source format 3.0 (quilt)
* Switch to dh(1) and debhelper compat 8
* Add missing misc:Depends.
* Include the upstream changelog.
* Update Debian standards version (no other changes needed).

[ Stefano Rivera ]
* Dropped README.source.
* Updated freeimage (3.9.5) fixes CVE-2011-1167, CVE-2011-0192,
  CVE-2010-2595
* Override lintian's embedded-library error for libtiff. It wasn't
  extricable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (c) 2005, Herv� Drolon, FreeImage Team
 
2
 * Copyright (c) 2005, Herve Drolon, FreeImage Team
3
3
 * All rights reserved.
4
4
 *
5
5
 * Redistribution and use in source and binary forms, with or without
26
26
 
27
27
#include "opj_includes.h"
28
28
 
29
 
opj_image_t* opj_image_create0() {
30
 
        opj_image_t *image = (opj_image_t*)opj_malloc(sizeof(opj_image_t));
 
29
opj_image_t* opj_image_create0(void) {
 
30
        opj_image_t *image = (opj_image_t*)opj_calloc(1, sizeof(opj_image_t));
31
31
        return image;
32
32
}
33
33
 
35
35
        int compno;
36
36
        opj_image_t *image = NULL;
37
37
 
38
 
        image = (opj_image_t*)opj_malloc(sizeof(opj_image_t));
 
38
        image = (opj_image_t*) opj_calloc(1, sizeof(opj_image_t));
39
39
        if(image) {
40
40
                image->color_space = clrspc;
41
41
                image->numcomps = numcmpts;
42
42
                /* allocate memory for the per-component information */
43
43
                image->comps = (opj_image_comp_t*)opj_malloc(image->numcomps * sizeof(opj_image_comp_t));
44
44
                if(!image->comps) {
 
45
                        fprintf(stderr,"Unable to allocate memory for image.\n");
45
46
                        opj_image_destroy(image);
46
47
                        return NULL;
47
48
                }
57
58
                        comp->prec = cmptparms[compno].prec;
58
59
                        comp->bpp = cmptparms[compno].bpp;
59
60
                        comp->sgnd = cmptparms[compno].sgnd;
60
 
                        comp->data = (int*)opj_malloc(comp->w * comp->h * sizeof(int));
 
61
                        comp->data = (int*) opj_calloc(comp->w * comp->h, sizeof(int));
61
62
                        if(!comp->data) {
 
63
                                fprintf(stderr,"Unable to allocate memory for image.\n");
62
64
                                opj_image_destroy(image);
63
65
                                return NULL;
64
66
                        }