summaryrefslogtreecommitdiffstats
path: root/win/tkWinDraw.c
diff options
context:
space:
mode:
authorchengyemao <chengyemao@noemail.net>2001-12-07 05:20:51 (GMT)
committerchengyemao <chengyemao@noemail.net>2001-12-07 05:20:51 (GMT)
commitcabd12851367c45357401886f9f29250c5ac1bf4 (patch)
tree09b1d3f5bde9e88be214bb7174a62c71a18f2bc9 /win/tkWinDraw.c
parent1c36aa02f5e6726c86574bead7e42f2450841d56 (diff)
downloadtk-cabd12851367c45357401886f9f29250c5ac1bf4.zip
tk-cabd12851367c45357401886f9f29250c5ac1bf4.tar.gz
tk-cabd12851367c45357401886f9f29250c5ac1bf4.tar.bz2
Added panic in TkPutImage in case of failure to allocate bitmap
FossilOrigin-Name: 251ce02cb8182c7a493f6cac048d633c29ae527f
Diffstat (limited to 'win/tkWinDraw.c')
-rw-r--r--win/tkWinDraw.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/win/tkWinDraw.c b/win/tkWinDraw.c
index eeaf334..27ce4ca 100644
--- a/win/tkWinDraw.c
+++ b/win/tkWinDraw.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinDraw.c,v 1.10 2001/12/07 00:02:57 chengyemao Exp $
+ * RCS: @(#) $Id: tkWinDraw.c,v 1.11 2001/12/07 05:20:52 chengyemao Exp $
*/
#include "tkWinInt.h"
@@ -591,7 +591,9 @@ TkPutImage(colors, ncolors, display, d, gc, image, src_x, src_y, dest_x,
}
if(!bitmap) {
panic("Fail to allocate bitmap\n");
- return
+ DeleteDC(dcMem);
+ TkWinReleaseDrawableDC(d, dc, &state);
+ return;
}
bitmap = SelectObject(dcMem, bitmap);
BitBlt(dc, dest_x, dest_y, width, height, dcMem, src_x, src_y, SRCCOPY);