Skip to content

Commit d2365a8

Browse files
committed
data => ZSTR_VAL(data)
1 parent 8ea035d commit d2365a8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

ext/gd/gd.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1482,17 +1482,17 @@ static int _php_image_type (zend_string *data)
14821482
return -1;
14831483
}
14841484

1485-
if (!memcmp(data, php_sig_gd2, sizeof(php_sig_gd2))) {
1485+
if (!memcmp(ZSTR_VAL(data), php_sig_gd2, sizeof(php_sig_gd2))) {
14861486
return PHP_GDIMG_TYPE_GD2;
1487-
} else if (!memcmp(data, php_sig_jpg, sizeof(php_sig_jpg))) {
1487+
} else if (!memcmp(ZSTR_VAL(data), php_sig_jpg, sizeof(php_sig_jpg))) {
14881488
return PHP_GDIMG_TYPE_JPG;
1489-
} else if (!memcmp(data, php_sig_png, sizeof(php_sig_png))) {
1489+
} else if (!memcmp(ZSTR_VAL(data), php_sig_png, sizeof(php_sig_png))) {
14901490
return PHP_GDIMG_TYPE_PNG;
1491-
} else if (!memcmp(data, php_sig_gif, sizeof(php_sig_gif))) {
1491+
} else if (!memcmp(ZSTR_VAL(data), php_sig_gif, sizeof(php_sig_gif))) {
14921492
return PHP_GDIMG_TYPE_GIF;
1493-
} else if (!memcmp(data, php_sig_bmp, sizeof(php_sig_bmp))) {
1493+
} else if (!memcmp(ZSTR_VAL(data), php_sig_bmp, sizeof(php_sig_bmp))) {
14941494
return PHP_GDIMG_TYPE_BMP;
1495-
} else if(!memcmp(data, php_sig_riff, sizeof(php_sig_riff)) && !memcmp(data + sizeof(php_sig_riff) + sizeof(uint32_t), php_sig_webp, sizeof(php_sig_webp))) {
1495+
} else if(!memcmp(ZSTR_VAL(data), php_sig_riff, sizeof(php_sig_riff)) && !memcmp(data + sizeof(php_sig_riff) + sizeof(uint32_t), php_sig_webp, sizeof(php_sig_webp))) {
14961496
return PHP_GDIMG_TYPE_WEBP;
14971497
}
14981498

@@ -1503,7 +1503,7 @@ static int _php_image_type (zend_string *data)
15031503
}
15041504

15051505
gdIOCtx *io_ctx;
1506-
io_ctx = gdNewDynamicCtxEx(8, data, 0);
1506+
io_ctx = gdNewDynamicCtxEx(8, ZSTR_VAL(data), 0);
15071507
if (io_ctx) {
15081508
if (_php_ctx_getmbi(io_ctx) == 0 && _php_ctx_getmbi(io_ctx) >= 0) {
15091509
io_ctx->gd_free(io_ctx);

0 commit comments

Comments
 (0)