]> granicus.if.org Git - php/commitdiff
MFH(r-1.356) Don't assume the array elements are arrays too
authorSara Golemon <pollita@php.net>
Sat, 7 Oct 2006 16:40:39 +0000 (16:40 +0000)
committerSara Golemon <pollita@php.net>
Sat, 7 Oct 2006 16:40:39 +0000 (16:40 +0000)
ext/gd/gd.c

index f42b06fec9b3f0aadf8a828d3625990c0af79631..8fe9c6ca5fdec5e5bbfad7c419dc0f1a07a40c7b 100644 (file)
@@ -5092,7 +5092,7 @@ PHP_FUNCTION(imageconvolution)
        }
 
        for (i=0; i<3; i++) {
-               if (zend_hash_index_find(Z_ARRVAL_P(hash_matrix), (i), (void **) &var) == SUCCESS) {
+               if (zend_hash_index_find(Z_ARRVAL_P(hash_matrix), (i), (void **) &var) == SUCCESS && Z_TYPE_PP(var) == IS_ARRAY) {
                        if (Z_TYPE_PP(var) != IS_ARRAY || zend_hash_num_elements(Z_ARRVAL_PP(var)) != 3 ) {
                                php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must have 3x3 array");
                                RETURN_FALSE;