Fixed Bug #65084 imagecreatefromjpeg fails with URL
Regression introduced in
8a90aad (drop of USE_GD_IOCTX)
Secure with php_stream_can_cast to avoid segfault in php_stream_cast.
(encountered when imagecreatefromxpm with URL)
- GD
. Fixed #65070 (bgcolor does not use the same format as the input image with
imagerotate). (Pierre)
+ . Fixed Bug #65060 (imagecreatefrom... crashes with user streams). (Remi)
+ . Fixed Bug #65084 (imagecreatefromjpeg fails with URL). (Remi)
20 Jun 2013, PHP 5.5.0
}
}
+
stream = php_stream_open_wrapper(file, "rb", REPORT_ERRORS|IGNORE_PATH|IGNORE_URL_WIN, NULL);
if (stream == NULL) {
RETURN_FALSE;
}
- ioctx_func_p = NULL; /* don't allow sockets without IOCtx */
-
if (image_type == PHP_GDIMG_TYPE_WEBP) {
size_t buff_size;
char *buff;
io_ctx->gd_free(io_ctx);
pefree(buff, 1);
}
- else {
+ else if (php_stream_can_cast(stream, PHP_STREAM_AS_STDIO)) {
/* try and force the stream to be FILE* */
if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_STDIO | PHP_STREAM_CAST_TRY_HARD, (void **) &fp, REPORT_ERRORS)) {
goto out_err;