Acces Violation in acPNG.pas

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #38241
    Gábor
    Participant

    I found an AccesViolation in acPNG.pas / procedure TPNGGraphic.LoadTransparency

    The original code , what cause an AV is this:

    SetLength(FTransparency, 256);

    Move(FRawBuffer^, FTransparency[0], Max(FHeader.Length, 256));

    if FHeader.Length < 256 then FillChar(FTransparency[FHeader.Length], 256 – FHeader.Length, $FF); If I modify the move command, then my program running correctly: Move(FRawBuffer^, FTransparency[0], FHeader.Length); I think, not neccesary move 256 byte always, because in next row you will fill all of unused space with $FF. And the Max function doesn't protect aginst memory overwrite, because if the FHeader.Length>256 the result of function will be larger than 256. Please review this problem, and fix it in next release. Thank you!

    #59407
    Support
    Keymaster

    Hello!

    Thank you for the message, I will check it.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.