@@ -220,7 +220,7 @@ ZEND_GET_MODULE(exif)
220
220
* is read or until there is no more data available to read. */
221
221
static ssize_t exif_read_from_stream_file_looped (php_stream * stream , char * buf , size_t count )
222
222
{
223
- ssize_t total_read = 0 ;
223
+ size_t total_read = 0 ;
224
224
while (total_read < count ) {
225
225
ssize_t ret = php_stream_read (stream , buf + total_read , count - total_read );
226
226
if (ret == -1 ) {
@@ -2185,17 +2185,13 @@ static image_info_data *exif_alloc_image_info_data(image_info_list *info_list) {
2185
2185
/* {{{ exif_iif_add_value
2186
2186
Add a value to image_info
2187
2187
*/
2188
- static void exif_iif_add_value (image_info_type * image_info , int section_index , char * name , int tag , int format , int length , void * value , size_t value_len , int motorola_intel )
2188
+ static void exif_iif_add_value (image_info_type * image_info , int section_index , char * name , int tag , int format , size_t length , void * value , size_t value_len , int motorola_intel )
2189
2189
{
2190
2190
size_t idex ;
2191
2191
void * vptr , * vptr_end ;
2192
2192
image_info_value * info_value ;
2193
2193
image_info_data * info_data ;
2194
2194
2195
- if (length < 0 ) {
2196
- return ;
2197
- }
2198
-
2199
2195
info_data = exif_alloc_image_info_data (& image_info -> info_list [section_index ]);
2200
2196
memset (info_data , 0 , sizeof (image_info_data ));
2201
2197
info_data -> tag = tag ;
@@ -2211,7 +2207,7 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
2211
2207
value = NULL ;
2212
2208
}
2213
2209
if (value ) {
2214
- length = ( int ) zend_strnlen (value , length );
2210
+ length = zend_strnlen (value , length );
2215
2211
info_value -> s = estrndup (value , length );
2216
2212
info_data -> length = length ;
2217
2213
} else {
@@ -2242,7 +2238,7 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
2242
2238
}
2243
2239
if (value ) {
2244
2240
if (tag == TAG_MAKER_NOTE ) {
2245
- length = ( int ) zend_strnlen (value , length );
2241
+ length = zend_strnlen (value , length );
2246
2242
}
2247
2243
2248
2244
/* do not recompute length here */
@@ -2264,14 +2260,14 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
2264
2260
case TAG_FMT_DOUBLE :
2265
2261
if (length == 0 ) {
2266
2262
break ;
2267
- } else
2263
+ }
2268
2264
if (length > 1 ) {
2269
2265
info_value -> list = safe_emalloc (length , sizeof (image_info_value ), 0 );
2270
2266
} else {
2271
2267
info_value = & info_data -> value ;
2272
2268
}
2273
2269
vptr_end = (char * ) value + value_len ;
2274
- for (idex = 0 ,vptr = value ; idex < ( size_t ) length ; idex ++ ,vptr = (char * ) vptr + php_tiff_bytes_per_format [format ]) {
2270
+ for (idex = 0 ,vptr = value ; idex < length ; idex ++ ,vptr = (char * ) vptr + php_tiff_bytes_per_format [format ]) {
2275
2271
if ((char * ) vptr_end - (char * ) vptr < php_tiff_bytes_per_format [format ]) {
2276
2272
exif_error_docref ("exif_iif_add_value" EXIFERR_CC , image_info , E_WARNING , "Value too short" );
2277
2273
break ;
@@ -2330,7 +2326,7 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
2330
2326
*/
2331
2327
static void exif_iif_add_tag (image_info_type * image_info , int section_index , char * name , int tag , int format , size_t length , void * value , size_t value_len )
2332
2328
{
2333
- exif_iif_add_value (image_info , section_index , name , tag , format , ( int ) length , value , value_len , image_info -> motorola_intel );
2329
+ exif_iif_add_value (image_info , section_index , name , tag , format , length , value , value_len , image_info -> motorola_intel );
2334
2330
}
2335
2331
/* }}} */
2336
2332
0 commit comments