Skip to content

Commit

Permalink
Merge branch 'master' of https://git.php.net/repository/php-src
Browse files Browse the repository at this point in the history
* '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
  • Loading branch information
cjbj committed Sep 9, 2013
2 parents 43289d6 + d321941 commit 3ce8b70
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ext/gd/libgd/gd_interpolation.c
Original file line number Diff line number Diff line change
Expand Up @@ -1063,13 +1063,15 @@ gdImagePtr gdImageScaleTwoPass(const gdImagePtr src, const unsigned int src_widt
if (tmp_im == NULL) {
return NULL;
}
gdImageSetInterpolationMethod(tmp_im, src->interpolation_id);
_gdScaleHoriz(src, src_width, src_height, tmp_im, new_width, src_height);

dst = gdImageCreateTrueColor(new_width, new_height);
if (dst == NULL) {
gdFree(tmp_im);
return NULL;
}
gdImageSetInterpolationMethod(dst, src->interpolation_id);
_gdScaleVert(tmp_im, new_width, src_height, dst, new_width, new_height);
gdFree(tmp_im);

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

_gdScaleHoriz(src, src_width, src_height, tmp_im, new_width, src_height);
_gdScaleVert(tmp_im, new_width, src_height, dst, new_width, new_height);

gdFree(tmp_im);
Expand Down
4 changes: 4 additions & 0 deletions ext/opcache/ZendAccelerator.c
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,10 @@ int zend_accel_invalidate(const char *filename, int filename_len, zend_bool forc
realpath = accelerator_orig_zend_resolve_path(filename, filename_len TSRMLS_CC);
#endif

if (!realpath) {
return FAILURE;
}

persistent_script = zend_accel_hash_find(&ZCSG(hash), realpath, strlen(realpath) + 1);
if (persistent_script && !persistent_script->corrupted) {
zend_file_handle file_handle;
Expand Down

0 comments on commit 3ce8b70

Please sign in to comment.