ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/tmaptiff.c
(Generate patch)

Comparing ray/src/common/tmaptiff.c (file contents):
Revision 3.11 by greg, Tue Jun 28 21:11:04 2011 UTC vs.
Revision 3.12 by greg, Sat Jan 15 16:57:46 2022 UTC

# Line 88 | Line 88 | tmLoadTIFF(TMstruct *tms, TMbright **lpp, uby8 **cpp,
88          float   *fa;
89          TIFF    *tif;
90          int     err;
91 <        union {uint16 *w; uint32 *l; float *f; MEM_PTR p;} sl;
91 >        union {uint16 *w; uint32 *l; float *f; void *p;} sl;
92          uint32  width, height;
93          int     tcase;
94          double  stonits;
# Line 231 | Line 231 | done:                                  /* clean up */
231                  free(sl.p);
232          if (err != TM_E_OK) {           /* free buffers on error */
233                  if (*lpp != NULL)
234 <                        free((MEM_PTR)*lpp);
234 >                        free(*lpp);
235                  *lpp = NULL;
236                  if (cpp != TM_NOCHROMP) {
237                          if (*cpp != TM_NOCHROM)
238 <                                free((MEM_PTR)*cpp);
238 >                                free(*cpp);
239                          *cpp = NULL;
240                  }
241                  *xp = *yp = 0;
# Line 282 | Line 282 | tmMapTIFF(uby8 **psp, int *xp, int *yp, int flags, RGB
282          if (cp == TM_NOCHROM) {
283                  *psp = (uby8 *)malloc(*xp * *yp * sizeof(uby8));
284                  if (*psp == NULL) {
285 <                        free((MEM_PTR)lp);
285 >                        free(lp);
286                          tmDone(tms);
287                          returnErr(TM_E_NOMEM);
288                  }
# Line 299 | Line 299 | tmMapTIFF(uby8 **psp, int *xp, int *yp, int flags, RGB
299          err = tmMapPixels(tms, *psp, lp, cp, *xp * *yp);
300  
301   done:                                   /* clean up */
302 <        free((MEM_PTR)lp);
302 >        free(lp);
303          tmDone(tms);
304          if (err != TM_E_OK) {           /* free memory on error */
305 <                free((MEM_PTR)*psp);
305 >                free(*psp);
306                  *psp = NULL;
307                  *xp = *yp = 0;
308                  returnErr(err);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines