[Ttssh2-commit] [4582] 壁紙ファイルを開けないときに落ちる問題を修正

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2011年 8月 13日 (土) 22:23:30 JST


Revision: 4582
          http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=4582
Author:   maya
Date:     2011-08-13 22:23:30 +0900 (Sat, 13 Aug 2011)

Log Message:
-----------
壁紙ファイルを開けないときに落ちる問題を修正

Modified Paths:
--------------
    trunk/teraterm/teraterm/vtdisp.c


-------------- next part --------------
Modified: trunk/teraterm/teraterm/vtdisp.c
===================================================================
--- trunk/teraterm/teraterm/vtdisp.c	2011-08-13 13:15:23 UTC (rev 4581)
+++ trunk/teraterm/teraterm/vtdisp.c	2011-08-13 13:23:30 UTC (rev 4582)
@@ -663,6 +663,9 @@
 	HBITMAP hBitmap = NULL;
 
 	hFile=CreateFile(File,GENERIC_READ,0,NULL,OPEN_EXISTING,0,NULL);
+	if (hFile == INVALID_HANDLE_VALUE) {
+		return (hBitmap);
+	}
 	nFileSize=GetFileSize(hFile,NULL);
 	hMem=GlobalAlloc(GMEM_MOVEABLE,nFileSize);
 	pvData=GlobalLock(hMem);
@@ -829,6 +832,9 @@
 		float ratio;
 
 		hbm = GetBitmapHandle(wi.filename);
+		if (hbm == NULL) {
+			goto createdc;
+		}
 
 #ifdef DEBUG_XP
 		//wi.pattern = BG_STRETCH; 
@@ -884,6 +890,7 @@
 	}
 
 	//•ÇŽ†DC‚ðì‚é
+createdc:
 	if(hbm)
 	{
 		BITMAP bm;



Ttssh2-commit メーリングリストの案内
Back to archive index