diff options
author | chengyemao <chengyemao@noemail.net> | 2001-12-07 00:02:57 (GMT) |
---|---|---|
committer | chengyemao <chengyemao@noemail.net> | 2001-12-07 00:02:57 (GMT) |
commit | 9900a32fdb4e5367ea63e25f2d20252bee024c33 (patch) | |
tree | 446e317273e3715dd93534ec96b6aa7b637fd28f /win/tkWinDraw.c | |
parent | 1138e6b28d6b52f71745d4c46c918fb04806c8af (diff) | |
download | tk-9900a32fdb4e5367ea63e25f2d20252bee024c33.zip tk-9900a32fdb4e5367ea63e25f2d20252bee024c33.tar.gz tk-9900a32fdb4e5367ea63e25f2d20252bee024c33.tar.bz2 |
Added panic to TkPutImage in case of failure to allocate bitmap
FossilOrigin-Name: 9337ddfcd0cfcc0c2053a1d3a8d779829ffa4aac
Diffstat (limited to 'win/tkWinDraw.c')
-rw-r--r-- | win/tkWinDraw.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/win/tkWinDraw.c b/win/tkWinDraw.c index 5b09693..eeaf334 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.9 2000/10/24 23:51:33 ericm Exp $ + * RCS: @(#) $Id: tkWinDraw.c,v 1.10 2001/12/07 00:02:57 chengyemao Exp $ */ #include "tkWinInt.h" @@ -589,6 +589,10 @@ TkPutImage(colors, ncolors, display, d, gc, image, src_x, src_y, dest_x, image->data, infoPtr, DIB_RGB_COLORS); ckfree((char *) infoPtr); } + if(!bitmap) { + panic("Fail to allocate bitmap\n"); + return + } bitmap = SelectObject(dcMem, bitmap); BitBlt(dc, dest_x, dest_y, width, height, dcMem, src_x, src_y, SRCCOPY); DeleteObject(SelectObject(dcMem, bitmap)); |