From 6d2a269946df5ba722f1326a85bdb95d679de263 Mon Sep 17 00:00:00 2001 From: chengyemao Date: Fri, 7 Dec 2001 04:17:25 +0000 Subject: Added panic in ImgPhotoInstanceSetSize in case of failure to get pixmap --- generic/tkImgPhoto.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 2a9d1df..59391a7 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -15,7 +15,7 @@ * Department of Computer Science, * Australian National University. * - * RCS: @(#) $Id: tkImgPhoto.c,v 1.24 2001/09/14 20:35:58 andreas_kupries Exp $ + * RCS: @(#) $Id: tkImgPhoto.c,v 1.25 2001/12/07 04:17:25 chengyemao Exp $ */ #include "tkInt.h" @@ -2534,6 +2534,10 @@ ImgPhotoInstanceSetSize(instancePtr) (masterPtr->width > 0) ? masterPtr->width: 1, (masterPtr->height > 0) ? masterPtr->height: 1, instancePtr->visualInfo.depth); + if(!newPixmap) { + panic("Fail to create pixmap with Tk_GetPixmap in ImgPhotoInstanceSetSize.\n"); + return; + } /* * The following is a gross hack needed to properly support colormaps -- cgit v0.12