1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-27 16:51:06 -07:00

Fix seg fault when image dimensions don't match (bug#80518)

* src/image.c (four_corners_best): [USE_CAIRO] Reset the image
dimensions to real values.
(Fimage_transforms_p): Fix typo.
This commit is contained in:
Alan Third 2026-03-01 17:57:18 +00:00
parent fedf45ca63
commit d40e5050be

View file

@ -1937,6 +1937,14 @@ four_corners_best (Emacs_Pix_Context pimg, int *corners,
RGB_PIXEL_COLOR best UNINIT;
int i, best_count;
#ifdef USE_CAIRO
/* Sometimes the Cairo codepath calls this function *after* the image
sizes have been modified by native-transforms, so the pimg
dimensions don't match WIDTH and HEIGHT. */
width = pimg->width;
height = pimg->height;
#endif
if (corners && corners[BOT_CORNER] >= 0)
{
/* Get the colors at the corner_pixels of pimg. */
@ -12848,7 +12856,7 @@ The list of capabilities can include one or more of the following:
{
#ifdef HAVE_NATIVE_TRANSFORMS
# if defined HAVE_IMAGEMAGICK || defined (USE_CAIRO) || defined (HAVE_NS) \
|| defined (HAVE_HAIKU) | defined HAVE_ANDROID
|| defined (HAVE_HAIKU) || defined HAVE_ANDROID
return list2 (Qscale, Qrotate90);
# elif defined (HAVE_X_WINDOWS) && defined (HAVE_XRENDER)
if (FRAME_DISPLAY_INFO (f)->xrender_supported_p)