Page 1 of 1

GFLSDK v2.54 memory overwrite bug???

Posted: Mon Dec 18, 2006 3:11 pm
by pepak
I am having serious trouble writing a Delphi component descended from TGraphic with GflSDK 2.54. The application keeps crashing with an EAccessViolation. After numerous tests I noticed a probable culprit: When I call gflDefaultLoadParams(LoadParams), it writes not only 120 bytes (size of TGFL_LOAD_PARAMS structure) but 132 bytes, overwriting other variables!! Could someone verify this on his system, please?

Posted: Thu Dec 28, 2006 9:59 am
by Grincheux
I have found the same problem with GFL_SAVE_PARAMS.
I have added two bytes at the end of the structure to solve the problem.
In an other way you can pass a buffer of 1024 byte and cast it to use the structure definition.

Posted: Wed Jan 24, 2007 9:40 am
by xnview
Grincheux wrote:I have found the same problem with GFL_SAVE_PARAMS.
I have added two bytes at the end of the structure to solve the problem.
In an other way you can pass a buffer of 1024 byte and cast it to use the structure definition.
Ok, i'll check

Posted: Thu Feb 01, 2007 6:40 pm
by MaierMan
Those 12 bits come from those 6 Camera members.
They are float (4-byte) but in Delphi UINT16 (2-byte).
6 * 2 = 12; 120 + 12 = 132

Make those five a "Single" and stuff will work again ;)

Posted: Thu Feb 01, 2007 6:47 pm
by MaierMan
TGFL_SAVE_PARAMS misses the UserParams:

Code: Select all

    ...
    UserParams: Pointer;
  end;

Posted: Sat Feb 24, 2007 8:49 am
by pepak
Just for the record, the load params were fixed in version 2.66