@@ -2643,14 +2643,15 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
26432643 } else {
26442644 decode = ImageInfo -> decode_unicode_le ;
26452645 }
2646+ /* XXX this will fail again if encoding_converter returns on error something different than SIZE_MAX */
26462647 if (zend_multibyte_encoding_converter (
26472648 (unsigned char * * )pszInfoPtr ,
26482649 & len ,
26492650 (unsigned char * )szValuePtr ,
26502651 ByteCount ,
26512652 zend_multibyte_fetch_encoding (ImageInfo -> encode_unicode TSRMLS_CC ),
26522653 zend_multibyte_fetch_encoding (decode TSRMLS_CC )
2653- TSRMLS_CC ) < 0 ) {
2654+ TSRMLS_CC ) == ( size_t ) -1 ) {
26542655 len = exif_process_string_raw (pszInfoPtr , szValuePtr , ByteCount );
26552656 }
26562657 return len ;
@@ -2663,14 +2664,15 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
26632664 * pszEncoding = estrdup ((const char * )szValuePtr );
26642665 szValuePtr = szValuePtr + 8 ;
26652666 ByteCount -= 8 ;
2667+ /* XXX this will fail again if encoding_converter returns on error something different than SIZE_MAX */
26662668 if (zend_multibyte_encoding_converter (
26672669 (unsigned char * * )pszInfoPtr ,
26682670 & len ,
26692671 (unsigned char * )szValuePtr ,
26702672 ByteCount ,
26712673 zend_multibyte_fetch_encoding (ImageInfo -> encode_jis TSRMLS_CC ),
26722674 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 ) {
26742676 len = exif_process_string_raw (pszInfoPtr , szValuePtr , ByteCount );
26752677 }
26762678 return len ;
@@ -2700,16 +2702,16 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
27002702static int exif_process_unicode (image_info_type * ImageInfo , xp_field_type * xp_field , int tag , char * szValuePtr , int ByteCount TSRMLS_DC )
27012703{
27022704 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 */
27052707 if (zend_multibyte_encoding_converter (
27062708 (unsigned char * * )& xp_field -> value ,
27072709 & xp_field -> size ,
27082710 (unsigned char * )szValuePtr ,
27092711 ByteCount ,
27102712 zend_multibyte_fetch_encoding (ImageInfo -> encode_unicode TSRMLS_CC ),
27112713 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 ) {
27132715 xp_field -> size = exif_process_string_raw (& xp_field -> value , szValuePtr , ByteCount );
27142716 }
27152717 return xp_field -> size ;
0 commit comments