]> git.pld-linux.org Git - packages/php.git/blob - php-bug-40073.patch
54ad0b59a38fafc7b4a9400255ed287051463ac9
[packages/php.git] / php-bug-40073.patch
1 --- php-5.2/ext/exif/exif.c     2006/10/10 22:22:43     1.173.2.5.2.4
2 +++ php-5.2/ext/exif/exif.c     2007/01/09 11:37:17     1.173.2.5.2.9
3 @@ -2,7 +2,7 @@
4     +----------------------------------------------------------------------+
5     | PHP Version 5                                                        |
6     +----------------------------------------------------------------------+
7 -   | Copyright (c) 1997-2006 The PHP Group                                |
8 +   | Copyright (c) 1997-2007 The PHP Group                                |
9     +----------------------------------------------------------------------+
10     | This source file is subject to version 3.01 of the PHP license,      |
11     | that is bundled with this package in the file LICENSE, and is        |
12 @@ -17,7 +17,7 @@
13     +----------------------------------------------------------------------+
14   */
15  
16 -/* $Id$ */
17 +/* $Id$ */
18  
19  /*  ToDos
20   *
21 @@ -139,7 +139,7 @@
22  };
23  /* }}} */
24  
25 -#define EXIF_VERSION "1.4 $Id$"
26 +#define EXIF_VERSION "1.4 $Id$"
27  
28  /* {{{ PHP_MINFO_FUNCTION
29   */
30 @@ -1599,6 +1599,7 @@
31         image_info->info_list[section_index].list = list;
32  
33         info_data  = &image_info->info_list[section_index].list[image_info->info_list[section_index].count];
34 +       memset(info_data, 0, sizeof(image_info_data));
35         info_data->tag    = tag;
36         info_data->format = format;
37         info_data->length = length;
38 @@ -3590,7 +3591,7 @@
39                                                                 exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "%s THUMBNAIL @0x%04X + 0x%04X", ImageInfo->Thumbnail.data ? "Ignore" : "Read", ImageInfo->Thumbnail.offset, ImageInfo->Thumbnail.size);
40  #endif
41                                                                 if (!ImageInfo->Thumbnail.data) {
42 -                                                                       ImageInfo->Thumbnail.data = emalloc(ImageInfo->Thumbnail.size);
43 +                                                                       ImageInfo->Thumbnail.data = safe_emalloc(ImageInfo->Thumbnail.size, 1, 0);
44                                                                         php_stream_seek(ImageInfo->infile, ImageInfo->Thumbnail.offset, SEEK_SET);
45                                                                         fgot = php_stream_read(ImageInfo->infile, ImageInfo->Thumbnail.data, ImageInfo->Thumbnail.size);
46                                                                         if (fgot < ImageInfo->Thumbnail.size) {
47 @@ -3623,7 +3624,7 @@
48                                         exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "%s THUMBNAIL @0x%04X + 0x%04X", ImageInfo->Thumbnail.data ? "Ignore" : "Read", ImageInfo->Thumbnail.offset, ImageInfo->Thumbnail.size);
49  #endif
50                                         if (!ImageInfo->Thumbnail.data && ImageInfo->Thumbnail.offset && ImageInfo->Thumbnail.size && ImageInfo->read_thumbnail) {
51 -                                               ImageInfo->Thumbnail.data = emalloc(ImageInfo->Thumbnail.size);
52 +                                               ImageInfo->Thumbnail.data = safe_emalloc(ImageInfo->Thumbnail.size, 1, 0);
53                                                 php_stream_seek(ImageInfo->infile, ImageInfo->Thumbnail.offset, SEEK_SET);
54                                                 fgot = php_stream_read(ImageInfo->infile, ImageInfo->Thumbnail.data, ImageInfo->Thumbnail.size);
55                                                 if (fgot < ImageInfo->Thumbnail.size) {
56 @@ -3914,7 +3915,7 @@
57                 exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "ByteOrderMotorola", ImageInfo.motorola_intel TSRMLS_CC);
58         }
59         if (ImageInfo.FocalLength) {
60 -               exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocalLength" TSRMLS_CC, "%4.1fmm", ImageInfo.FocalLength);
61 +               exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocalLength" TSRMLS_CC, "%4.1Fmm", ImageInfo.FocalLength);
62                 if(ImageInfo.CCDWidth) {
63                         exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "35mmFocalLength" TSRMLS_CC, "%dmm", (int)(ImageInfo.FocalLength/ImageInfo.CCDWidth*35+0.5));
64                 }
65 @@ -3924,19 +3925,19 @@
66         }
67         if(ImageInfo.ExposureTime>0) {
68                 if(ImageInfo.ExposureTime <= 0.5) {
69 -                       exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime" TSRMLS_CC, "%0.3f s (1/%d)", ImageInfo.ExposureTime, (int)(0.5 + 1/ImageInfo.ExposureTime));
70 +                       exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime" TSRMLS_CC, "%0.3F s (1/%d)", ImageInfo.ExposureTime, (int)(0.5 + 1/ImageInfo.ExposureTime));
71                 } else {
72 -                       exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime" TSRMLS_CC, "%0.3f s", ImageInfo.ExposureTime);
73 +                       exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime" TSRMLS_CC, "%0.3F s", ImageInfo.ExposureTime);
74                 }
75         }
76         if(ImageInfo.ApertureFNumber) {
77 -               exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ApertureFNumber" TSRMLS_CC, "f/%.1f", ImageInfo.ApertureFNumber);
78 +               exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ApertureFNumber" TSRMLS_CC, "f/%.1F", ImageInfo.ApertureFNumber);
79         }
80         if(ImageInfo.Distance) {
81                 if(ImageInfo.Distance<0) {
82                         exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "FocusDistance", "Infinite" TSRMLS_CC);
83                 } else {
84 -                       exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocusDistance" TSRMLS_CC, "%0.2fm", ImageInfo.Distance);
85 +                       exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocusDistance" TSRMLS_CC, "%0.2Fm", ImageInfo.Distance);
86                 }
87         }
88         if (ImageInfo.UserComment) {
89 @@ -4005,7 +4006,7 @@
90     Reads the embedded thumbnail */
91  PHP_FUNCTION(exif_thumbnail)
92  {
93 -       zval *p_width, *p_height, *p_imagetype;
94 +       zval *p_width = 0, *p_height = 0, *p_imagetype = 0;
95         char *p_name;
96         int p_name_len, ret, arg_c = ZEND_NUM_ARGS();
97         image_info_type ImageInfo;
This page took 0.029405 seconds and 2 git commands to generate.