diff VSs_tinyjpeg/loadjpeg.c @ 2:a52de05d2e2b

changed malloc to VMS malloc
author Nina Engelhardt <nengel@mailbox.tu-berlin.de>
date Tue, 10 Jul 2012 11:42:46 +0200
parents 7e13c9ecc89c
children 42d636fee562
line diff
     1.1 --- a/VSs_tinyjpeg/loadjpeg.c	Thu Jul 05 04:15:38 2012 -0700
     1.2 +++ b/VSs_tinyjpeg/loadjpeg.c	Tue Jul 10 11:42:46 2012 +0200
     1.3 @@ -130,7 +130,7 @@
     1.4  	if (fp == NULL)
     1.5  		perror("Cannot open image");//exitmessage("Cannot open filename\n");
     1.6  	length_of_file = filesize(fp);
     1.7 -	buf = (unsigned char *)malloc(length_of_file + 4);
     1.8 +	buf = (unsigned char *)VMS_App__malloc(length_of_file + 4);
     1.9  	if (buf == NULL)
    1.10  		exitmessage("Not enough memory for loading file\n");
    1.11  	fread(buf, length_of_file, 1, fp);
    1.12 @@ -148,12 +148,12 @@
    1.13  	tinyjpeg_get_size(jdec, &width, &height);
    1.14  
    1.15  	// RGB stuff
    1.16 -	rgb_data = (uint8_t *)malloc(width * height * RGB_DEPTH);
    1.17 +	rgb_data = (uint8_t *)VMS_App__malloc(width * height * RGB_DEPTH);
    1.18  	jdec->components[0] = rgb_data;
    1.19  
    1.20  	// this jpeg decoder only supports full MCUs for simplicity
    1.21  	ntasks = (jdec->mcus_in_width * jdec->mcus_in_height)/ jdec->restart_interval;
    1.22 -	jdec_task = (struct jdec_private **) malloc ( ntasks * sizeof(struct jdec_private*));
    1.23 +	jdec_task = (struct jdec_private **) VMS_App__malloc ( ntasks * sizeof(struct jdec_private*));
    1.24  	
    1.25  
    1.26          //VSs setup
    1.27 @@ -191,9 +191,9 @@
    1.28  	    tinyjpeg_free(jdec_task[i]);
    1.29  	}
    1.30  	fclose(fp);		
    1.31 -	free(buf);
    1.32 -	free(rgb_data);
    1.33 -	free(jdec_task);
    1.34 +	VMS_App__free(buf);
    1.35 +	VMS_App__free(rgb_data);
    1.36 +	VMS_App__free(jdec_task);
    1.37  	return 0;
    1.38  }
    1.39