FLTK logo

[master] 4d934e0 - Add check against NULL pointer (fix for issue #338).

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] 4d934e0 - Add check against NULL pointer (fix for issue #338). "ManoloFLTK" Dec 19, 2021  
 
commit 4d934e003a55be05416e2b137f73734664a47dce
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Sun Dec 19 08:50:15 2021 +0100
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Sun Dec 19 08:50:25 2021 +0100

    Add check against NULL pointer (fix for issue #338).

 src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
index cc94739..484830e 100644
--- src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
+++ src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
@@ -275,7 +275,8 @@ void Fl_GDI_Graphics_Driver::set_spot(int font, int size, int X, int Y, int W, i
     cfs.ptCurrentPos.y = int(Y * s) - int(tw->labelsize() * s);
     // Attempt to have temporary text entered by input method use scaled font.
     // Does good, but still not always effective.
-    SelectObject((HDC)gc(), ((Fl_GDI_Font_Descriptor*)font_descriptor())->fid);
+    Fl_GDI_Font_Descriptor *desc = (Fl_GDI_Font_Descriptor*)font_descriptor();
+    if (desc) SelectObject((HDC)gc(), desc->fid);
     MapWindowPoints(fl_xid(win), fl_xid(tw), &cfs.ptCurrentPos, 1);
     flImmSetCompositionWindow(himc, &cfs);
     flImmReleaseContext(fl_xid(tw), himc);
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.