* image.el (image-type-from-buffer): Only return supported image type.
authorChong Yidong <cyd@gnu.org>
Thu, 26 Apr 2012 08:43:20 +0000 (16:43 +0800)
committerChong Yidong <cyd@gnu.org>
Thu, 26 Apr 2012 08:43:20 +0000 (16:43 +0800)
Fixes: debbugs:9045

lisp/ChangeLog
lisp/image.el

index a709c01..ad6fd35 100644 (file)
@@ -1,5 +1,8 @@
 2012-04-26  Chong Yidong  <cyd@gnu.org>
 
+       * image.el (image-type-from-buffer): Only return supported image
+       type (Bug#9045).
+
        * vc/diff-mode.el (diff-beginning-of-hunk): Return a meaningful
        value, for symmetry with diff-end-of-hunk.
        (diff-split-hunk, diff-find-source-location)
index 348c208..27e41a5 100644 (file)
@@ -282,7 +282,9 @@ be determined."
                  types nil)
          (setq types (cdr types)))))
     (goto-char opoint)
-    type))
+    (and type
+        (memq type image-types)
+        type)))
 
 
 ;;;###autoload