diff --git a/lcl/include/imglist.inc b/lcl/include/imglist.inc index cce52516d7..b9bf08d659 100644 --- a/lcl/include/imglist.inc +++ b/lcl/include/imglist.inc @@ -471,7 +471,7 @@ var ListImg, DeviceImg: TLazIntfImage; ImgHandle, MskHandle: HBitmap; begin - if (FCount = 0) or (Image = nil) then Exit; + if (Index < 0) or (Index >= FCount) or (Image = nil) then Exit; GetRawImage(Index, RawImg);