Fix UB in the integer overflow check in Layer::Layer()
[chromium-blink-merge.git] / third_party / libexif / chromium.patch
blob02c93997cb2059f18f8f17ae177777de04dec60e
1 diff -urN libexif-0.6.21/config.h libexif-0.6.21.modified/config.h
2 --- libexif-0.6.21/config.h 1969-12-31 16:00:00.000000000 -0800
3 +++ libexif-0.6.21.modified/config.h 2012-07-14 15:31:49.614388000 -0700
4 @@ -0,0 +1,360 @@
5 +#if defined(_WIN32)
6 +/* config.h. Generated by configure. */
7 +/* config.h.in. Generated from configure.ac by autoheader. */
9 +/* Define to 1 if translation of program messages to the user's native
10 + language is requested. */
11 +/* #undef ENABLE_NLS 1 */
13 +/* The gettext domain we're using */
14 +/* #undef GETTEXT_PACKAGE "libexif-12" */
16 +/* Define locale directory. */
17 +/* #undef LOCALEDIR "UTF-8" */
19 +/* Define to 1 if we want to bind text domain and enable GETTEXT_PACKAGE and
20 + * LOCALE_DIR */
21 +/* #undef BIND_TEXTDOMAIN 1 */
23 +/* Define if the GNU dcgettext() function is already present or preinstalled.
24 + */
25 +/* #undef HAVE_DCGETTEXT 1 */
27 +/* Define to 1 if you have the <dlfcn.h> header file. */
28 +#define HAVE_DLFCN_H 1
30 +/* Define if the GNU gettext() function is already present or preinstalled. */
31 +#define HAVE_GETTEXT 1
33 +/* Define if you have the iconv() function. */
34 +#define HAVE_ICONV 1
36 +/* Define to 1 if you have the <inttypes.h> header file. */
37 +#define HAVE_INTTYPES_H 1
39 +/* Define to 1 if you have the <memory.h> header file. */
40 +#define HAVE_MEMORY_H 1
42 +/* Define to 1 if you have the <stdint.h> header file. */
43 +/* #undef HAVE_STDINT_H 1 */
45 +/* Define to 1 if you have the <stdlib.h> header file. */
46 +#define HAVE_STDLIB_H 1
48 +/* Define to 1 if you have the <strings.h> header file. */
49 +#define HAVE_STRINGS_H 1
51 +/* Define to 1 if you have the <string.h> header file. */
52 +#define HAVE_STRING_H 1
54 +/* Define to 1 if you have the <sys/stat.h> header file. */
55 +#define HAVE_SYS_STAT_H 1
57 +/* Define to 1 if you have the <sys/types.h> header file. */
58 +#define HAVE_SYS_TYPES_H 1
60 +/* Define to 1 if you have the <unistd.h> header file. */
61 +#define HAVE_UNISTD_H 1
63 +/* Define as const if the declaration of iconv() needs const. */
64 +#define ICONV_CONST
66 +/* Name of package */
67 +#define PACKAGE "libexif"
69 +/* Define to the address where bug reports for this package should be sent. */
70 +#define PACKAGE_BUGREPORT "libexif-devel@lists.sourceforge.net"
72 +/* Define to the full name of this package. */
73 +#define PACKAGE_NAME "EXIF library"
75 +/* Define to the full name and version of this package. */
76 +#define PACKAGE_STRING "EXIF library 0.6.21"
78 +/* Define to the one symbol short name of this package. */
79 +#define PACKAGE_TARNAME "libexif"
81 +/* Define to the version of this package. */
82 +#define PACKAGE_VERSION "0.6.21"
84 +/* Define to 1 if you have the ANSI C header files. */
85 +#define STDC_HEADERS 1
87 +/* Version number of package */
88 +#define VERSION "0.6.21"
90 +#elif !defined(__APPLE__)
91 +/* config.h. Generated by configure. */
92 +/* config.h.in. Generated from configure.ac by autoheader. */
94 +/* #define __cplusplus 1 */
95 +#define LOCALEDIR "UTF-8"
97 +/* Define to 1 if translation of program messages to the user's native
98 + language is requested. */
99 +/* #undef ENABLE_NLS */
101 +/* The gettext domain we're using */
102 +/* #undef GETTEXT_PACKAGE "libexif-12" */
104 +/* Define locale directory. */
105 +/* #undef LOCALEDIR "UTF-8" */
107 +/* Define to 1 if we want to bind text domain and enable GETTEXT_PACKAGE and
108 + * LOCALE_DIR */
109 +/* #undef BIND_TEXTDOMAIN 1 */
111 +/* Define if the GNU dcgettext() function is already present or preinstalled.
112 + */
113 +#define HAVE_DCGETTEXT 1
115 +/* Define to 1 if you have the <dlfcn.h> header file. */
116 +#define HAVE_DLFCN_H 1
118 +/* Define if the GNU gettext() function is already present or preinstalled. */
119 +#define HAVE_GETTEXT 1
121 +/* Define if you have the iconv() function. */
122 +#define HAVE_ICONV 1
124 +/* Define to 1 if you have the <inttypes.h> header file. */
125 +#define HAVE_INTTYPES_H 1
127 +/* Define to 1 if you have the <memory.h> header file. */
128 +#define HAVE_MEMORY_H 1
130 +/* Define to 1 if you have the <stdint.h> header file. */
131 +#define HAVE_STDINT_H 1
133 +/* Define to 1 if you have the <stdlib.h> header file. */
134 +#define HAVE_STDLIB_H 1
136 +/* Define to 1 if you have the <strings.h> header file. */
137 +#define HAVE_STRINGS_H 1
139 +/* Define to 1 if you have the <string.h> header file. */
140 +#define HAVE_STRING_H 1
142 +/* Define to 1 if you have the <sys/stat.h> header file. */
143 +#define HAVE_SYS_STAT_H 1
145 +/* Define to 1 if you have the <sys/types.h> header file. */
146 +#define HAVE_SYS_TYPES_H 1
148 +/* Define to 1 if you have the <unistd.h> header file. */
149 +#define HAVE_UNISTD_H 1
151 +/* Define as const if the declaration of iconv() needs const. */
152 +#define ICONV_CONST
154 +/* Name of package */
155 +#define PACKAGE "libexif"
157 +/* Define to the address where bug reports for this package should be sent. */
158 +#define PACKAGE_BUGREPORT "libexif-devel@lists.sourceforge.net"
160 +/* Define to the full name of this package. */
161 +#define PACKAGE_NAME "EXIF library"
163 +/* Define to the full name and version of this package. */
164 +#define PACKAGE_STRING "EXIF library 0.6.21"
166 +/* Define to the one symbol short name of this package. */
167 +#define PACKAGE_TARNAME "libexif"
169 +/* Define to the version of this package. */
170 +#define PACKAGE_VERSION "0.6.21"
172 +/* Define to 1 if you have the ANSI C header files. */
173 +#define STDC_HEADERS 1
175 +/* Version number of package */
176 +#define VERSION "0.6.21"
178 +/* Define to empty if `const' does not conform to ANSI C. */
179 +/* #undef const */
180 +#else // defined(__APPLE__)
182 +// We need different definitions for the iPhone from desktop OS X,
183 +// we get the necessary #define from TargetConditionals.h
184 +#include <TargetConditionals.h>
186 +#if TARGET_OS_IPHONE
188 +/* config.h. Generated from config.h.in by configure. */
189 +/* config.h.in. Generated from configure.ac by autoheader. */
191 +/* Define to 1 if translation of program messages to the user's native
192 + language is requested. */
193 +/* #undef ENABLE_NLS */
195 +/* The gettext domain we're using */
196 +/* #undef GETTEXT_PACKAGE "libexif-12" */
198 +/* Define locale directory. */
199 +/* #undef LOCALEDIR "UTF-8" */
201 +/* Define to 1 if we want to bind text domain and enable GETTEXT_PACKAGE and
202 + * LOCALE_DIR */
203 +/* #undef BIND_TEXTDOMAIN 1 */
205 +/* Define if the GNU dcgettext() function is already present or preinstalled.
206 + */
207 +/* #undef HAVE_DCGETTEXT */
209 +/* Define to 1 if you have the <dlfcn.h> header file. */
210 +#define HAVE_DLFCN_H 1
212 +/* Define if the GNU gettext() function is already present or preinstalled. */
213 +/* #undef HAVE_GETTEXT */
215 +/* Define if you have the iconv() function. */
216 +/* #undef HAVE_ICONV */
218 +/* Define to 1 if you have the <inttypes.h> header file. */
219 +#define HAVE_INTTYPES_H 1
221 +/* Define to 1 if you have the <memory.h> header file. */
222 +#define HAVE_MEMORY_H 1
224 +/* Define to 1 if you have the <stdint.h> header file. */
225 +#define HAVE_STDINT_H 1
227 +/* Define to 1 if you have the <stdlib.h> header file. */
228 +#define HAVE_STDLIB_H 1
230 +/* Define to 1 if you have the <strings.h> header file. */
231 +#define HAVE_STRINGS_H 1
233 +/* Define to 1 if you have the <string.h> header file. */
234 +#define HAVE_STRING_H 1
236 +/* Define to 1 if you have the <sys/stat.h> header file. */
237 +#define HAVE_SYS_STAT_H 1
239 +/* Define to 1 if you have the <sys/types.h> header file. */
240 +#define HAVE_SYS_TYPES_H 1
242 +/* Define to 1 if you have the <unistd.h> header file. */
243 +#define HAVE_UNISTD_H 1
245 +/* Define as const if the declaration of iconv() needs const. */
246 +/* #undef ICONV_CONST */
248 +/* Name of package */
249 +#define PACKAGE "libexif"
251 +/* Define to the address where bug reports for this package should be sent. */
252 +#define PACKAGE_BUGREPORT "libexif-devel@lists.sourceforge.net"
254 +/* Define to the full name of this package. */
255 +#define PACKAGE_NAME "EXIF library"
257 +/* Define to the full name and version of this package. */
258 +#define PACKAGE_STRING "EXIF library 0.6.21"
260 +/* Define to the one symbol short name of this package. */
261 +#define PACKAGE_TARNAME "libexif"
263 +/* Define to the version of this package. */
264 +#define PACKAGE_VERSION "0.6.21"
266 +/* Define to 1 if you have the ANSI C header files. */
267 +#define STDC_HEADERS 1
269 +/* Version number of package */
270 +#define VERSION "0.6.21"
272 +/* Define to empty if `const' does not conform to ANSI C. */
273 +/* #undef const */
274 +#else // !TARGET_OS_IPHONE
276 +/* config.h. Generated from config.h.in by configure. */
277 +/* config.h.in. Generated from configure.ac by autoheader. */
279 +/* Define to 1 if translation of program messages to the user's native
280 + language is requested. */
281 +/* #undef ENABLE_NLS */
283 +/* The gettext domain we're using */
284 +/* #undef GETTEXT_PACKAGE "libexif-12" */
286 +/* Define locale directory. */
287 +/* #undef LOCALEDIR "UTF-8" */
289 +/* Define to 1 if we want to bind text domain and enable GETTEXT_PACKAGE and
290 + * LOCALE_DIR */
291 +/* #undef BIND_TEXTDOMAIN 1 */
293 +/* Define if the GNU dcgettext() function is already present or preinstalled.
294 + */
295 +/* #undef HAVE_DCGETTEXT */
297 +/* Define to 1 if you have the <dlfcn.h> header file. */
298 +#define HAVE_DLFCN_H 1
300 +/* Define if the GNU gettext() function is already present or preinstalled. */
301 +/* #undef HAVE_GETTEXT */
303 +/* Define if you have the iconv() function. */
304 +#define HAVE_ICONV 1
306 +/* Define to 1 if you have the <inttypes.h> header file. */
307 +#define HAVE_INTTYPES_H 1
309 +/* Define to 1 if you have the <memory.h> header file. */
310 +#define HAVE_MEMORY_H 1
312 +/* Define to 1 if you have the <stdint.h> header file. */
313 +#define HAVE_STDINT_H 1
315 +/* Define to 1 if you have the <stdlib.h> header file. */
316 +#define HAVE_STDLIB_H 1
318 +/* Define to 1 if you have the <strings.h> header file. */
319 +#define HAVE_STRINGS_H 1
321 +/* Define to 1 if you have the <string.h> header file. */
322 +#define HAVE_STRING_H 1
324 +/* Define to 1 if you have the <sys/stat.h> header file. */
325 +#define HAVE_SYS_STAT_H 1
327 +/* Define to 1 if you have the <sys/types.h> header file. */
328 +#define HAVE_SYS_TYPES_H 1
330 +/* Define to 1 if you have the <unistd.h> header file. */
331 +#define HAVE_UNISTD_H 1
333 +/* Define as const if the declaration of iconv() needs const. */
334 +#define ICONV_CONST
336 +/* Name of package */
337 +#define PACKAGE "libexif"
339 +/* Define to the address where bug reports for this package should be sent. */
340 +#define PACKAGE_BUGREPORT "libexif-devel@lists.sourceforge.net"
342 +/* Define to the full name of this package. */
343 +#define PACKAGE_NAME "EXIF library"
345 +/* Define to the full name and version of this package. */
346 +#define PACKAGE_STRING "EXIF library 0.6.21"
348 +/* Define to the one symbol short name of this package. */
349 +#define PACKAGE_TARNAME "libexif"
351 +/* Define to the version of this package. */
352 +#define PACKAGE_VERSION "0.6.21"
354 +/* Define to 1 if you have the ANSI C header files. */
355 +#define STDC_HEADERS 1
357 +/* Version number of package */
358 +#define VERSION "0.6.21"
360 +/* Define to empty if `const' does not conform to ANSI C. */
361 +/* #undef const */
362 +#endif // TARGET_OS_IPHONE
364 +#endif // _WIN32
365 diff -urN libexif-0.6.21/libexif/canon/mnote-canon-tag.c libexif-0.6.21.modified/libexif/canon/mnote-canon-tag.c
366 --- libexif-0.6.21/libexif/canon/mnote-canon-tag.c 2012-06-19 14:47:28.000000000 -0700
367 +++ libexif-0.6.21.modified/libexif/canon/mnote-canon-tag.c 2012-07-14 15:51:50.883304000 -0700
368 @@ -159,8 +159,9 @@
369 mnote_canon_tag_get_title (MnoteCanonTag t)
371 unsigned int i;
373 +#if defined(BIND_TEXTDOMAIN)
374 bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
375 +#endif
376 for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
377 if (table[i].tag == t) return (_(table[i].title));
378 return NULL;
379 @@ -194,7 +195,9 @@
380 if (table[i].tag == t) {
381 if (!table[i].description || !*table[i].description)
382 return "";
383 +#if defined(BIND_TEXTDOMAIN)
384 bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
385 +#endif
386 return _(table[i].description);
388 return NULL;
389 diff -urN libexif-0.6.21/libexif/exif-entry.c libexif-0.6.21.modified/libexif/exif-entry.c
390 --- libexif-0.6.21/libexif/exif-entry.c 2012-07-12 11:31:56.000000000 -0700
391 +++ libexif-0.6.21.modified/libexif/exif-entry.c 2012-07-14 15:52:26.955243000 -0700
392 @@ -860,8 +860,9 @@
394 * bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
396 +#if defined(BIND_TEXTDOMAIN)
397 bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
399 +#endif
400 if (!e || !e->parent || !e->parent->parent || !maxlen)
401 return val;
403 diff -urN libexif-0.6.21/libexif/exif-format.c libexif-0.6.21.modified/libexif/exif-format.c
404 --- libexif-0.6.21/libexif/exif-format.c 2009-11-07 22:59:07.000000000 -0800
405 +++ libexif-0.6.21.modified/libexif/exif-format.c 2012-07-14 15:19:07.203071000 -0700
406 @@ -61,8 +61,9 @@
408 * bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
410 +#if defined(BIND_TEXTDOMAIN)
411 bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
413 +#endif
414 for (i = 0; ExifFormatTable[i].name; i++)
415 if (ExifFormatTable[i].format == format)
416 return _(ExifFormatTable[i].name);
417 diff -urN libexif-0.6.21/libexif/exif-mem.c libexif-0.6.21.modified/libexif/exif-mem.c
418 --- libexif-0.6.21/libexif/exif-mem.c 2009-09-24 23:35:48.000000000 -0700
419 +++ libexif-0.6.21.modified/libexif/exif-mem.c 2012-07-14 15:26:44.722234000 -0700
420 @@ -1,3 +1,22 @@
421 +/* exif-mem.c
423 + * Copyright (c) 2003 Lutz Mueller <lutz@users.sourceforge.net>
425 + * This library is free software; you can redistribute it and/or
426 + * modify it under the terms of the GNU Lesser General Public
427 + * License as published by the Free Software Foundation; either
428 + * version 2 of the License, or (at your option) any later version.
430 + * This library is distributed in the hope that it will be useful,
431 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
432 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
433 + * Lesser General Public License for more details.
435 + * You should have received a copy of the GNU Lesser General Public
436 + * License along with this library; if not, write to the
437 + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
438 + * Boston, MA 02110-1301 USA.
439 + */
440 #include <libexif/exif-mem.h>
442 #include <stdlib.h>
443 diff -urN libexif-0.6.21/libexif/exif-tag.c libexif-0.6.21.modified/libexif/exif-tag.c
444 --- libexif-0.6.21/libexif/exif-tag.c 2011-05-18 21:41:02.000000000 -0700
445 +++ libexif-0.6.21.modified/libexif/exif-tag.c 2012-07-14 15:53:31.642803000 -0700
446 @@ -990,7 +990,9 @@
448 * bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
450 +#if defined(BIND_TEXTDOMAIN)
451 bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
452 +#endif
453 return _(ExifTagTable[i].title);
456 @@ -1024,7 +1026,9 @@
458 * bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
460 +#if defined(BIND_TEXTDOMAIN)
461 bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
462 +#endif
463 return _(ExifTagTable[i].description);
466 diff -urN libexif-0.6.21/libexif/exif-utils.h libexif-0.6.21.modified/libexif/exif-utils.h
467 --- libexif-0.6.21/libexif/exif-utils.h 2009-10-26 23:06:11.000000000 -0700
468 +++ libexif-0.6.21.modified/libexif/exif-utils.h 2012-07-14 15:27:36.664810000 -0700
469 @@ -30,6 +30,7 @@
470 #include <libexif/exif-byte-order.h>
471 #include <libexif/exif-format.h>
472 #include <libexif/_stdint.h>
473 +#include "config.h"
476 /* If these definitions don't work for you, please let us fix the
477 diff -urN libexif-0.6.21/libexif/fuji/mnote-fuji-tag.c libexif-0.6.21.modified/libexif/fuji/mnote-fuji-tag.c
478 --- libexif-0.6.21/libexif/fuji/mnote-fuji-tag.c 2012-06-19 14:47:28.000000000 -0700
479 +++ libexif-0.6.21.modified/libexif/fuji/mnote-fuji-tag.c 2012-07-14 15:54:31.132701000 -0700
480 @@ -83,7 +83,9 @@
482 unsigned int i;
484 +#if defined(BIND_TEXTDOMAIN)
485 bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
486 +#endif
487 for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
488 if (table[i].tag == t) return (_(table[i].title));
489 return NULL;
490 @@ -98,7 +100,9 @@
491 if (table[i].tag == t) {
492 if (!table[i].description || !*table[i].description)
493 return "";
494 +#if defined(BIND_TEXTDOMAIN)
495 bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
496 +#endif
497 return _(table[i].description);
499 return NULL;
500 diff -urN libexif-0.6.21/libexif/olympus/mnote-olympus-tag.c libexif-0.6.21.modified/libexif/olympus/mnote-olympus-tag.c
501 --- libexif-0.6.21/libexif/olympus/mnote-olympus-tag.c 2011-05-18 21:41:02.000000000 -0700
502 +++ libexif-0.6.21.modified/libexif/olympus/mnote-olympus-tag.c 2012-07-14 15:55:36.303176000 -0700
503 @@ -208,7 +208,9 @@
505 unsigned int i;
507 +#if defined(BIND_TEXTDOMAIN)
508 bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
509 +#endif
510 for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
511 if (table[i].tag == t) return (_(table[i].title));
512 return NULL;
513 @@ -223,7 +225,9 @@
514 if (table[i].tag == t) {
515 if (!table[i].description || !*table[i].description)
516 return "";
517 +#if defined(BIND_TEXTDOMAIN)
518 bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
519 +#endif
520 return _(table[i].description);
522 return NULL;
523 diff -urN libexif-0.6.21/libexif/pentax/mnote-pentax-tag.c libexif-0.6.21.modified/libexif/pentax/mnote-pentax-tag.c
524 --- libexif-0.6.21/libexif/pentax/mnote-pentax-tag.c 2011-05-18 21:41:02.000000000 -0700
525 +++ libexif-0.6.21.modified/libexif/pentax/mnote-pentax-tag.c 2012-07-14 15:56:30.122590000 -0700
526 @@ -153,7 +153,9 @@
528 unsigned int i;
530 +#if defined(BIND_TEXTDOMAIN)
531 bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
532 +#endif
533 for (i = 0; i < sizeof (table) / sizeof (table[0]); i++)
534 if (table[i].tag == t) return (_(table[i].title));
535 return NULL;
536 @@ -168,7 +170,9 @@
537 if (table[i].tag == t) {
538 if (!table[i].description || !*table[i].description)
539 return "";
540 +#if defined(BIND_TEXTDOMAIN)
541 bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
542 +#endif
543 return _(table[i].description);
545 return NULL;
546 diff -urN libexif-0.6.21/libexif/_stdint.h libexif-0.6.21.modified/libexif/_stdint.h
547 --- libexif-0.6.21/libexif/_stdint.h 2012-07-12 13:34:01.000000000 -0700
548 +++ libexif-0.6.21.modified/libexif/_stdint.h 2012-07-14 15:30:09.884802000 -0700
549 @@ -1,2 +1,15 @@
550 /* This file is generated automatically by configure */
551 +#if defined(_WIN32)
552 +// Define C99 equivalent types.
553 +typedef signed char int8_t;
554 +typedef signed short int16_t;
555 +typedef signed int int32_t;
556 +typedef signed long long int64_t;
557 +typedef signed long long ssize_t;
558 +typedef unsigned char uint8_t;
559 +typedef unsigned short uint16_t;
560 +typedef unsigned int uint32_t;
561 +typedef unsigned long long uint64_t;
562 +#else
563 #include <stdint.h>
564 +#endif