gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: crash when using local display but not remote


From: Fred Kiefer
Subject: Re: crash when using local display but not remote
Date: Fri, 7 Feb 2020 10:20:51 +0100


> Am 04.02.2020 um 22:15 schrieb Sergii Stoian <address@hidden>:
> 
>> On Feb 4, 2020, at 20:43, Fred Kiefer <address@hidden> wrote:
>> In general it is safer as the new code expects that the image is fully 
>> packed. (You moved the comment with the conversion from unpacked to packed 
>> over to the swap function) If bytesPerRow is not equal to w * 4 (there may 
>> be a few extra bytes to align stuff a bit), then the new code would not 
>> transfer the correct data.  We would end up with random garbage in between. 
>> But in this special case the image comes from GSStandardImage and at least 
>> for the case where there are alpha values that function should already 
>> return a packed image. Thinking about it the old code should only have 
>> copied w * 4 bytes for each row. The old code could have written a few bytes 
>> past the pixels array.
> 
> Clear explanation, thank you. It is a usual case when image contains more 
> bytes than image size (width * height)?
> I feel we need to return back old code with your explanation in comment.
> What do you think?

I just committed a merge of the two approaches (plus a few compiler warning 
fixes). I hope this should fix Riccardo's issues. It might also be slightly 
faster as I removed the copy before the colour swap. At least the swapColor 
function now does what the comment above it claims :-)

Fred


reply via email to

[Prev in Thread] Current Thread [Next in Thread]