Menu

cyWebBrowserDemo.exe crashes when btnGetHtml pressed

adem0x
2015-07-05
2015-07-06
  • adem0x

    adem0x - 2015-07-05

    I am using XE under Win7 x64 and MS IE v11 updated to the latest.

    Here is the steps to produce the crash:

    Use any UR

    1) Press 'Navivage To URL'
    2) Wait till it loads
    3) Press 'Get HTML'
    4) It crashes

    I have traced it upto GetStreamEncoding() in cyIEUtils.pas and it crashes when TEncoding.GetBufferEncoding() is called in there.

    I have no idea why it is happening.

    Can someone help, please.

     
  • adem0x

    adem0x - 2015-07-06

    I've solved the mystery :)

    'Result' has to be initialized to nil before calling TEncoding.GetBufferEncoding().

    Could you please add that to the sources.

    function GetStreamEncoding(aStream: TStream): TEncoding;
    var
    Bytes: TBytes;
    Size: Int64;
    begin
    Result := nil; // <----- THIS HAS TO BE ADDED.
    aStream.Seek(0, soFromBeginning);
    Size := aStream.Size;
    SetLength(Bytes, Size);
    aStream.ReadBuffer(Pointer(Bytes)^, Size);
    TEncoding.GetBufferEncoding(Bytes, Result);
    end;

     
  • Maurício

    Maurício - 2015-07-06

    Hi,

    thank you. Seems 64 bits/XE was the cause.
    I will add your correction for next release.

    Regards,
    Mauricio

     

Anonymous
Anonymous

Add attachments
Cancel