From 1dd55f7ae00bed7c199a7a1406a31f64b80b6e27 Mon Sep 17 00:00:00 2001 From: juha Date: Tue, 5 Feb 2013 21:39:16 +0000 Subject: [PATCH] LCL: Don't access first element of ImageList if length=0. Issue #23834, patch from wp git-svn-id: trunk@40192 - --- lcl/include/imglist.inc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lcl/include/imglist.inc b/lcl/include/imglist.inc index 48795c9821..000f6073f5 100644 --- a/lcl/include/imglist.inc +++ b/lcl/include/imglist.inc @@ -1085,7 +1085,8 @@ begin WriteLRSInteger(AStream,Height); //images - AStream.Write(FData[0], FWidth * FHeight * FCount * SizeOf(FData[0])); + if Count > 0 then + AStream.Write(FData[0], FWidth * FHeight * FCount * SizeOf(FData[0])); end; {------------------------------------------------------------------------------ @@ -1161,7 +1162,8 @@ var FHeight := ReadLRSCardinal(AStream); AllocData(FCount); - AStream.ReadBuffer(FData[0], FWidth * FHeight * FCount * SizeOf(FData[0])) ; + if FCount > 0 then + AStream.ReadBuffer(FData[0], FWidth * FHeight * FCount * SizeOf(FData[0])) ; FChanged := true; Change;