@@ -125,7 +125,7 @@ PHP_FUNCTION(opencv_circle){
125125 */
126126PHP_FUNCTION (opencv_fill_poly){
127127
128- long ncontours = 1 , lineType = LINE_8, shift = 0 ;
128+ long lineType = LINE_8, shift = 0 ;
129129 zval *img_zval, *color_zval, *offset_point_zval = NULL ;
130130 zval *points_zval;
131131 opencv_point_object *offset_object;
@@ -138,6 +138,7 @@ PHP_FUNCTION(opencv_fill_poly){
138138 RETURN_NULL ();
139139 }
140140
141+ long ncontours = 1 ;
141142 unsigned long point_count = zend_hash_num_elements (Z_ARRVAL_P (points_zval));
142143 Point root_points[ncontours][point_count];
143144 opencv_point_object *point_object;
@@ -157,7 +158,8 @@ PHP_FUNCTION(opencv_fill_poly){
157158 }
158159 }ZEND_HASH_FOREACH_END ();
159160
160- const Point* pts[ncontours] = {root_points[0 ]};
161+ const Point* pts[ncontours];
162+ pts[0 ] = root_points[0 ];
161163 int npts[] = {(int )point_count};
162164 Point offset;
163165 zval *offset_point_real_zval;
@@ -671,8 +673,7 @@ PHP_FUNCTION(opencv_threshold){
671673 dst_object = Z_PHP_MAT_OBJ_P (dst_real_zval);
672674 dst_object->mat = new Mat (dst);
673675 }
674- threshold (*src_object->mat , *dst_object->mat , thresh, maxval, (int )type);
675-
676+ RETURN_DOUBLE (threshold (*src_object->mat , *dst_object->mat , thresh, maxval, (int )type));
676677}
677678
678679/* *
0 commit comments