mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-20 12:09:06 +02:00
* fix invalid pointer access in the handling of WM_PAINT before InitVideo has
allocated videobuf in the win16 video unit git-svn-id: trunk@37638 -
This commit is contained in:
parent
87846323c2
commit
d3d60568e7
@ -52,6 +52,9 @@ var
|
||||
CharWidth,CharHeight: SmallInt;
|
||||
begin
|
||||
dc:=BeginPaint(hwnd,FarAddr(ps));
|
||||
{ don't do anything, before the video unit has been fully initialized... }
|
||||
if videobuf<>nil then
|
||||
begin
|
||||
oldfont:=SelectObject(dc,GetStockObject(OEM_FIXED_FONT));
|
||||
GetTextMetrics(dc,FarAddr(Metrics));
|
||||
CharWidth:=Metrics.tmMaxCharWidth;
|
||||
@ -81,6 +84,7 @@ begin
|
||||
SetTextColor(dc,oldtextcolor);
|
||||
SetBkColor(dc,oldbkcolor);
|
||||
SelectObject(dc,oldfont);
|
||||
end;
|
||||
EndPaint(hwnd,FarAddr(ps));
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user