diff options
| author | Alan Third | 2026-03-01 17:57:18 +0000 |
|---|---|---|
| committer | Alan Third | 2026-03-04 19:21:36 +0000 |
| commit | d40e5050be2029613bc0ca3e18f9a50d8187ee8e (patch) | |
| tree | 0d99b2abbf89a98cfbecfa78ea12ef9cfb3b7137 /src | |
| parent | fedf45ca6337788717b2e7490fc4ef7b85195b61 (diff) | |
| download | emacs-d40e5050be2029613bc0ca3e18f9a50d8187ee8e.tar.gz emacs-d40e5050be2029613bc0ca3e18f9a50d8187ee8e.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/image.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/image.c b/src/image.c index 8dfab77ce43..9d0a620188f 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -1937,6 +1937,14 @@ four_corners_best (Emacs_Pix_Context pimg, int *corners, | |||
| 1937 | RGB_PIXEL_COLOR best UNINIT; | 1937 | RGB_PIXEL_COLOR best UNINIT; |
| 1938 | int i, best_count; | 1938 | int i, best_count; |
| 1939 | 1939 | ||
| 1940 | #ifdef USE_CAIRO | ||
| 1941 | /* Sometimes the Cairo codepath calls this function *after* the image | ||
| 1942 | sizes have been modified by native-transforms, so the pimg | ||
| 1943 | dimensions don't match WIDTH and HEIGHT. */ | ||
| 1944 | width = pimg->width; | ||
| 1945 | height = pimg->height; | ||
| 1946 | #endif | ||
| 1947 | |||
| 1940 | if (corners && corners[BOT_CORNER] >= 0) | 1948 | if (corners && corners[BOT_CORNER] >= 0) |
| 1941 | { | 1949 | { |
| 1942 | /* Get the colors at the corner_pixels of pimg. */ | 1950 | /* 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: | |||
| 12848 | { | 12856 | { |
| 12849 | #ifdef HAVE_NATIVE_TRANSFORMS | 12857 | #ifdef HAVE_NATIVE_TRANSFORMS |
| 12850 | # if defined HAVE_IMAGEMAGICK || defined (USE_CAIRO) || defined (HAVE_NS) \ | 12858 | # if defined HAVE_IMAGEMAGICK || defined (USE_CAIRO) || defined (HAVE_NS) \ |
| 12851 | || defined (HAVE_HAIKU) | defined HAVE_ANDROID | 12859 | || defined (HAVE_HAIKU) || defined HAVE_ANDROID |
| 12852 | return list2 (Qscale, Qrotate90); | 12860 | return list2 (Qscale, Qrotate90); |
| 12853 | # elif defined (HAVE_X_WINDOWS) && defined (HAVE_XRENDER) | 12861 | # elif defined (HAVE_X_WINDOWS) && defined (HAVE_XRENDER) |
| 12854 | if (FRAME_DISPLAY_INFO (f)->xrender_supported_p) | 12862 | if (FRAME_DISPLAY_INFO (f)->xrender_supported_p) |