Skip to content

Commit 3ce8b70

Browse files
committed
Merge branch 'master' of https://git.php.net/repository/php-src
* 'master' of https://git.php.net/repository/php-src: ensure that the defined interpolation method is used by the generic scaling functions Fixed issue #128 (opcache_invalidate segmentation fault) 5.5.5 now
2 parents 43289d6 + d321941 commit 3ce8b70

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

ext/gd/libgd/gd_interpolation.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1063,13 +1063,15 @@ gdImagePtr gdImageScaleTwoPass(const gdImagePtr src, const unsigned int src_widt
10631063
if (tmp_im == NULL) {
10641064
return NULL;
10651065
}
1066+
gdImageSetInterpolationMethod(tmp_im, src->interpolation_id);
10661067
_gdScaleHoriz(src, src_width, src_height, tmp_im, new_width, src_height);
10671068

10681069
dst = gdImageCreateTrueColor(new_width, new_height);
10691070
if (dst == NULL) {
10701071
gdFree(tmp_im);
10711072
return NULL;
10721073
}
1074+
gdImageSetInterpolationMethod(dst, src->interpolation_id);
10731075
_gdScaleVert(tmp_im, new_width, src_height, dst, new_width, new_height);
10741076
gdFree(tmp_im);
10751077

@@ -1084,8 +1086,9 @@ gdImagePtr Scale(const gdImagePtr src, const unsigned int src_width, const unsig
10841086
if (tmp_im == NULL) {
10851087
return NULL;
10861088
}
1087-
_gdScaleHoriz(src, src_width, src_height, tmp_im, new_width, src_height);
1089+
gdImageSetInterpolationMethod(tmp_im, src->interpolation_id);
10881090

1091+
_gdScaleHoriz(src, src_width, src_height, tmp_im, new_width, src_height);
10891092
_gdScaleVert(tmp_im, new_width, src_height, dst, new_width, new_height);
10901093

10911094
gdFree(tmp_im);

ext/opcache/ZendAccelerator.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,6 +1062,10 @@ int zend_accel_invalidate(const char *filename, int filename_len, zend_bool forc
10621062
realpath = accelerator_orig_zend_resolve_path(filename, filename_len TSRMLS_CC);
10631063
#endif
10641064

1065+
if (!realpath) {
1066+
return FAILURE;
1067+
}
1068+
10651069
persistent_script = zend_accel_hash_find(&ZCSG(hash), realpath, strlen(realpath) + 1);
10661070
if (persistent_script && !persistent_script->corrupted) {
10671071
zend_file_handle file_handle;

0 commit comments

Comments
 (0)