@@ -2643,14 +2643,15 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
2643
2643
} else {
2644
2644
decode = ImageInfo -> decode_unicode_le ;
2645
2645
}
2646
+ /* XXX this will fail again if encoding_converter returns on error something different than SIZE_MAX */
2646
2647
if (zend_multibyte_encoding_converter (
2647
2648
(unsigned char * * )pszInfoPtr ,
2648
2649
& len ,
2649
2650
(unsigned char * )szValuePtr ,
2650
2651
ByteCount ,
2651
2652
zend_multibyte_fetch_encoding (ImageInfo -> encode_unicode TSRMLS_CC ),
2652
2653
zend_multibyte_fetch_encoding (decode TSRMLS_CC )
2653
- TSRMLS_CC ) < 0 ) {
2654
+ TSRMLS_CC ) == ( size_t ) -1 ) {
2654
2655
len = exif_process_string_raw (pszInfoPtr , szValuePtr , ByteCount );
2655
2656
}
2656
2657
return len ;
@@ -2663,14 +2664,15 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
2663
2664
* pszEncoding = estrdup ((const char * )szValuePtr );
2664
2665
szValuePtr = szValuePtr + 8 ;
2665
2666
ByteCount -= 8 ;
2667
+ /* XXX this will fail again if encoding_converter returns on error something different than SIZE_MAX */
2666
2668
if (zend_multibyte_encoding_converter (
2667
2669
(unsigned char * * )pszInfoPtr ,
2668
2670
& len ,
2669
2671
(unsigned char * )szValuePtr ,
2670
2672
ByteCount ,
2671
2673
zend_multibyte_fetch_encoding (ImageInfo -> encode_jis TSRMLS_CC ),
2672
2674
zend_multibyte_fetch_encoding (ImageInfo -> motorola_intel ? ImageInfo -> decode_jis_be : ImageInfo -> decode_jis_le TSRMLS_CC )
2673
- TSRMLS_CC ) < 0 ) {
2675
+ TSRMLS_CC ) == ( size_t ) -1 ) {
2674
2676
len = exif_process_string_raw (pszInfoPtr , szValuePtr , ByteCount );
2675
2677
}
2676
2678
return len ;
@@ -2700,16 +2702,16 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
2700
2702
static int exif_process_unicode (image_info_type * ImageInfo , xp_field_type * xp_field , int tag , char * szValuePtr , int ByteCount TSRMLS_DC )
2701
2703
{
2702
2704
xp_field -> tag = tag ;
2703
-
2704
- /* Copy the comment */
2705
+
2706
+ /* XXX this will fail again if encoding_converter returns on error something different than SIZE_MAX */
2705
2707
if (zend_multibyte_encoding_converter (
2706
2708
(unsigned char * * )& xp_field -> value ,
2707
2709
& xp_field -> size ,
2708
2710
(unsigned char * )szValuePtr ,
2709
2711
ByteCount ,
2710
2712
zend_multibyte_fetch_encoding (ImageInfo -> encode_unicode TSRMLS_CC ),
2711
2713
zend_multibyte_fetch_encoding (ImageInfo -> motorola_intel ? ImageInfo -> decode_unicode_be : ImageInfo -> decode_unicode_le TSRMLS_CC )
2712
- TSRMLS_CC ) < 0 ) {
2714
+ TSRMLS_CC ) == ( size_t ) -1 ) {
2713
2715
xp_field -> size = exif_process_string_raw (& xp_field -> value , szValuePtr , ByteCount );
2714
2716
}
2715
2717
return xp_field -> size ;
0 commit comments