Mercurial > emacs
comparison src/image.c @ 83436:f67e432d150c
Fix crash in lookup_image on termcap frames.
* src/xdisp.c (get_glyph_string_clip_rects): Add extra parentheses and
braces to prevent compiler warnings.
(calc_pixel_width_or_height): Add xassert to check that the
frame is alive. Don't call `lookup_image' on a termcap frame.
* image.c (lookup_image): Don't initialize `c' until the xasserts have
been run.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-476
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Fri, 30 Dec 2005 05:29:31 +0000 |
parents | 9574f135f272 |
children | b98066f4aa10 |
comparison
equal
deleted
inserted
replaced
83435:5efa63b61ac5 | 83436:f67e432d150c |
---|---|
1720 int | 1720 int |
1721 lookup_image (f, spec) | 1721 lookup_image (f, spec) |
1722 struct frame *f; | 1722 struct frame *f; |
1723 Lisp_Object spec; | 1723 Lisp_Object spec; |
1724 { | 1724 { |
1725 struct image_cache *c = FRAME_X_IMAGE_CACHE (f); | 1725 struct image_cache *c; |
1726 struct image *img; | 1726 struct image *img; |
1727 int i; | 1727 int i; |
1728 unsigned hash; | 1728 unsigned hash; |
1729 struct gcpro gcpro1; | 1729 struct gcpro gcpro1; |
1730 EMACS_TIME now; | 1730 EMACS_TIME now; |
1731 | 1731 |
1732 /* F must be a window-system frame, and SPEC must be a valid image | 1732 /* F must be a window-system frame, and SPEC must be a valid image |
1733 specification. */ | 1733 specification. */ |
1734 xassert (FRAME_WINDOW_P (f)); | 1734 xassert (FRAME_WINDOW_P (f)); |
1735 xassert (valid_image_p (spec)); | 1735 xassert (valid_image_p (spec)); |
1736 | |
1737 c = FRAME_X_IMAGE_CACHE (f); | |
1736 | 1738 |
1737 GCPRO1 (spec); | 1739 GCPRO1 (spec); |
1738 | 1740 |
1739 /* Look up SPEC in the hash table of the image cache. */ | 1741 /* Look up SPEC in the hash table of the image cache. */ |
1740 hash = sxhash (spec, 0); | 1742 hash = sxhash (spec, 0); |