Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1143)

Side by Side Diff: third_party/libtiff/tif_getimage.c

Issue 2545723004: Fix a leak when TIFFRGBAImageBegin fails (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/libtiff/README.pdfium ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* $Id: tif_getimage.c,v 1.90 2015-06-17 01:34:08 bfriesen Exp $ */ 1 /* $Id: tif_getimage.c,v 1.90 2015-06-17 01:34:08 bfriesen Exp $ */
2 2
3 /* 3 /*
4 * Copyright (c) 1991-1997 Sam Leffler 4 * Copyright (c) 1991-1997 Sam Leffler
5 * Copyright (c) 1991-1997 Silicon Graphics, Inc. 5 * Copyright (c) 1991-1997 Silicon Graphics, Inc.
6 * 6 *
7 * Permission to use, copy, modify, distribute, and sell this software and 7 * Permission to use, copy, modify, distribute, and sell this software and
8 * its documentation for any purpose is hereby granted without fee, provided 8 * its documentation for any purpose is hereby granted without fee, provided
9 * that (i) the above copyright notices and this permission notice appear in 9 * that (i) the above copyright notices and this permission notice appear in
10 * all copies of the software and related documentation, and (ii) the names of 10 * all copies of the software and related documentation, and (ii) the names of
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 } 471 }
472 } else { 472 } else {
473 if (!PickSeparateCase(img)) { 473 if (!PickSeparateCase(img)) {
474 sprintf(emsg, "Sorry, can not handle image"); 474 sprintf(emsg, "Sorry, can not handle image");
475 goto fail_return; 475 goto fail_return;
476 } 476 }
477 } 477 }
478 return 1; 478 return 1;
479 479
480 fail_return: 480 fail_return:
481 _TIFFfree( img->redcmap ); 481 TIFFRGBAImageEnd(img);
482 _TIFFfree( img->greencmap );
483 _TIFFfree( img->bluecmap );
484 img->redcmap = img->greencmap = img->bluecmap = NULL;
485 return 0; 482 return 0;
486 } 483 }
487 484
488 int 485 int
489 TIFFRGBAImageGet(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) 486 TIFFRGBAImageGet(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
490 { 487 {
491 if (img->get == NULL) { 488 if (img->get == NULL) {
492 TIFFErrorExt(img->tif->tif_clientdata, TIFFFileName(img->tif), " No \"get\" routine setup"); 489 TIFFErrorExt(img->tif->tif_clientdata, TIFFFileName(img->tif), " No \"get\" routine setup");
493 return (0); 490 return (0);
494 } 491 }
(...skipping 2433 matching lines...) Expand 10 before | Expand all | Expand 10 after
2928 } 2925 }
2929 2926
2930 /* vim: set ts=8 sts=8 sw=8 noet: */ 2927 /* vim: set ts=8 sts=8 sw=8 noet: */
2931 /* 2928 /*
2932 * Local Variables: 2929 * Local Variables:
2933 * mode: c 2930 * mode: c
2934 * c-basic-offset: 8 2931 * c-basic-offset: 8
2935 * fill-column: 78 2932 * fill-column: 78
2936 * End: 2933 * End:
2937 */ 2934 */
OLDNEW
« no previous file with comments | « third_party/libtiff/README.pdfium ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698