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

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

Issue 2452293002: libtiff: Fix unsigned vs signed comparison warning. (Closed)
Patch Set: Created 4 years, 1 month 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/0009-HeapBufferOverflow-PixarLogDecode.patch ('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_pixarlog.c,v 1.39 2012-12-10 17:27:13 tgl Exp $ */ 1 /* $Id: tif_pixarlog.c,v 1.39 2012-12-10 17:27:13 tgl Exp $ */
2 2
3 /* 3 /*
4 * Copyright (c) 1996-1997 Sam Leffler 4 * Copyright (c) 1996-1997 Sam Leffler
5 * Copyright (c) 1996 Pixar 5 * Copyright (c) 1996 Pixar
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 766 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 we need to simplify this code to reflect a ZLib that is likely updat ed 777 we need to simplify this code to reflect a ZLib that is likely updat ed
778 to deal with 8byte memory sizes, though this code will respond 778 to deal with 8byte memory sizes, though this code will respond
779 apropriately even before we simplify it */ 779 apropriately even before we simplify it */
780 sp->stream.avail_out = (uInt) (nsamples * sizeof(uint16)); 780 sp->stream.avail_out = (uInt) (nsamples * sizeof(uint16));
781 if (sp->stream.avail_out != nsamples * sizeof(uint16)) 781 if (sp->stream.avail_out != nsamples * sizeof(uint16))
782 { 782 {
783 TIFFErrorExt(tif->tif_clientdata, module, "ZLib cannot deal with buffers this size"); 783 TIFFErrorExt(tif->tif_clientdata, module, "ZLib cannot deal with buffers this size");
784 return (0); 784 return (0);
785 } 785 }
786 /* Check that we will not fill more than what was allocated */ 786 /* Check that we will not fill more than what was allocated */
787 » if (sp->stream.avail_out > sp->tbuf_size) 787 » if ((tmsize_t)sp->stream.avail_out > sp->tbuf_size)
788 { 788 {
789 TIFFErrorExt(tif->tif_clientdata, module, "sp->stream.avail_out > sp->tbuf_size"); 789 TIFFErrorExt(tif->tif_clientdata, module, "sp->stream.avail_out > sp->tbuf_size");
790 return (0); 790 return (0);
791 } 791 }
792 do { 792 do {
793 int state = inflate(&sp->stream, Z_PARTIAL_FLUSH); 793 int state = inflate(&sp->stream, Z_PARTIAL_FLUSH);
794 if (state == Z_STREAM_END) { 794 if (state == Z_STREAM_END) {
795 break; /* XXX */ 795 break; /* XXX */
796 } 796 }
797 if (state == Z_DATA_ERROR) { 797 if (state == Z_DATA_ERROR) {
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
1441 #endif /* PIXARLOG_SUPPORT */ 1441 #endif /* PIXARLOG_SUPPORT */
1442 1442
1443 /* vim: set ts=8 sts=8 sw=8 noet: */ 1443 /* vim: set ts=8 sts=8 sw=8 noet: */
1444 /* 1444 /*
1445 * Local Variables: 1445 * Local Variables:
1446 * mode: c 1446 * mode: c
1447 * c-basic-offset: 8 1447 * c-basic-offset: 8
1448 * fill-column: 78 1448 * fill-column: 78
1449 * End: 1449 * End:
1450 */ 1450 */
OLDNEW
« no previous file with comments | « third_party/libtiff/0009-HeapBufferOverflow-PixarLogDecode.patch ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698