emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r116479: Avoid crashes on MS-Windows when JPEG image


From: Eli Zaretskii
Subject: [Emacs-diffs] trunk r116479: Avoid crashes on MS-Windows when JPEG images are too large.
Date: Wed, 19 Feb 2014 17:26:48 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116479
revision-id: address@hidden
parent: address@hidden
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Wed 2014-02-19 19:26:14 +0200
message:
  Avoid crashes on MS-Windows when JPEG images are too large.
  
   src/image.c (x_create_x_image_and_pixmap) [HAVE_NTGUI]: If
   CreateDIBSection returns an error indication, zero out *ximg after
   destroying the image.  This avoids crashes in memory allocations
   due to the fact that some of the callers also call
   x_destroy_x_image, which will attempt to free an already free'd
   block of memory.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/image.c                    image.c-20091113204419-o5vbwnq5f7feedwu-2969
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-02-18 10:52:00 +0000
+++ b/src/ChangeLog     2014-02-19 17:26:14 +0000
@@ -1,3 +1,12 @@
+2014-02-19  Eli Zaretskii  <address@hidden>
+
+       * image.c (x_create_x_image_and_pixmap) [HAVE_NTGUI]: If
+       CreateDIBSection returns an error indication, zero out *ximg after
+       destroying the image.  This avoids crashes in memory allocations
+       due to the fact that some of the callers also call
+       x_destroy_x_image, which will attempt to free an already free'd
+       block of memory.
+
 2014-02-18  Martin Rudalics  <address@hidden>
 
        * widget.c (update_various_frame_slots): Don't set

=== modified file 'src/image.c'
--- a/src/image.c       2014-02-12 07:50:24 +0000
+++ b/src/image.c       2014-02-19 17:26:14 +0000
@@ -2019,6 +2019,7 @@
       XSETINT (errcode, err);
       image_error ("Unable to create bitmap, error code %d", errcode, Qnil);
       x_destroy_x_image (*ximg);
+      *ximg = NULL;
       return 0;
     }
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]