aboutsummaryrefslogtreecommitdiffstats
path: root/src/image.c
diff options
context:
space:
mode:
authorJoakim Verona2012-05-30 14:08:12 +0200
committerJoakim Verona2012-05-30 14:08:12 +0200
commit70700d8c47a35b19e29607ac5f0ed322bdd78249 (patch)
tree4fa00d3fac00025354f0b6e23dcda1b58689a094 /src/image.c
parent44fce8ffe7198991c41c985ff4e67ec7d407907e (diff)
parent72cb32cf2f0938dd7dc733eed77b1ed1e497b053 (diff)
downloademacs-70700d8c47a35b19e29607ac5f0ed322bdd78249.tar.gz
emacs-70700d8c47a35b19e29607ac5f0ed322bdd78249.zip
upstream
Diffstat (limited to 'src/image.c')
-rw-r--r--src/image.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/image.c b/src/image.c
index 73490fe2865..a3b64b74997 100644
--- a/src/image.c
+++ b/src/image.c
@@ -771,10 +771,9 @@ parse_image_spec (Lisp_Object spec, struct image_keyword *keywords,
771 /* Record that we recognized the keyword. If a keywords 771 /* Record that we recognized the keyword. If a keywords
772 was found more than once, it's an error. */ 772 was found more than once, it's an error. */
773 keywords[i].value = value; 773 keywords[i].value = value;
774 ++keywords[i].count;
775
776 if (keywords[i].count > 1) 774 if (keywords[i].count > 1)
777 return 0; 775 return 0;
776 ++keywords[i].count;
778 777
779 /* Check type of value against allowed type. */ 778 /* Check type of value against allowed type. */
780 switch (keywords[i].type) 779 switch (keywords[i].type)
@@ -1754,6 +1753,7 @@ lookup_image (struct frame *f, Lisp_Object spec)
1754 `:ascent ASCENT', `:margin MARGIN', `:relief RELIEF', 1753 `:ascent ASCENT', `:margin MARGIN', `:relief RELIEF',
1755 `:background COLOR'. */ 1754 `:background COLOR'. */
1756 Lisp_Object ascent, margin, relief, bg; 1755 Lisp_Object ascent, margin, relief, bg;
1756 int relief_bound;
1757 1757
1758 ascent = image_spec_value (spec, QCascent, NULL); 1758 ascent = image_spec_value (spec, QCascent, NULL);
1759 if (INTEGERP (ascent)) 1759 if (INTEGERP (ascent))
@@ -1771,7 +1771,8 @@ lookup_image (struct frame *f, Lisp_Object spec)
1771 } 1771 }
1772 1772
1773 relief = image_spec_value (spec, QCrelief, NULL); 1773 relief = image_spec_value (spec, QCrelief, NULL);
1774 if (INTEGERP (relief)) 1774 relief_bound = INT_MAX - max (img->hmargin, img->vmargin);
1775 if (RANGED_INTEGERP (- relief_bound, relief, relief_bound))
1775 { 1776 {
1776 img->relief = XINT (relief); 1777 img->relief = XINT (relief);
1777 img->hmargin += eabs (img->relief); 1778 img->hmargin += eabs (img->relief);