View Issue Details

IDProjectCategoryView StatusLast Update
0032013FPCFCLpublic2017-07-24 20:41
ReporterValdas Jankūnas Assigned ToMarco van de Voort  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionduplicate 
PlatformLinux 64bitOSKubuntu 17.04 
Product Version3.0.2 
Summary0032013: "TFPCustomImage.LoadFromStream" throws exception "Invalid chunklength" when compiled with FPC v3.0.2
DescriptionI'm using code (LCL)(see attached minimal project):

    stream := TLazarusResourceStream.Create('image_for_resource', nil);
    image := TLazIntfImage.Create(0,0);
    image.LoadFromStream(stream);

It works without problems with FPC v3.0.0 and earlier versions. After I updated it to v3.0.2 I always getting an Exception on line "LoadFromStream":

TApplication.HandleException Error while reading stream: Invalid chunklength
  Stack trace:
  $00000000004C6BDE
  $00000000004C76A9
  $000000000060BFB2 line 2851 of include/control.inc
  $0000000000639F2A line 55 of include/buttoncontrol.inc
  $000000000063A773 line 169 of include/buttons.inc
  $0000000000639E16 line 21 of include/buttoncontrol.inc
  $0000000000435B7F
  $00000000005FD77D line 5404 of include/wincontrol.inc
  $00000000006777AB line 5728 of qtwidgets.pas
  $0000000000678739 line 6101 of qtwidgets.pas
  $00007F00C7430F70
  $00007F00C8343632

Same exception I got when using code (wrote quick FCL-only test case)(see attached minimal project):

    fs := TFileStream.Create ('image_for_resource.png', fmOpenRead);
    image := TFPMemoryImage.Create(10, 10);
    image.LoadFromStream(fs);

This code works without problems when it is compiled with FPC v3.0.0.
Steps To ReproduceCompile project, run application and press Button1 or Button2.
Additional InformationRelated LCL bug 0032005
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget
Attached Files

Relationships

duplicate of 0032025 closedMichael Van Canneyt FPC Issues with the fp-image readers 
related to 0032005 closedwp Lazarus "TLazIntfImage.LoadFromStream" throws "Invalid chunklength" after update to FPC 3.0.2 

Activities

Valdas Jankūnas

2017-06-13 23:43

reporter  

test_project.zip (130,228 bytes)

Marco van de Voort

2017-07-01 14:00

manager   ~0101403

A more detailed bugreport for the same issue is filed under 0032025

I tested the code in this project, and the traceback confirms that it enters the PNM reader.

Issue History

Date Modified Username Field Change
2017-06-13 23:43 Valdas Jankūnas New Issue
2017-06-13 23:43 Valdas Jankūnas File Added: test_project.zip
2017-06-14 11:48 Michl Relationship added related to 0032005
2017-07-01 13:59 Marco van de Voort Relationship added related to 0032025
2017-07-01 13:59 Marco van de Voort Relationship deleted related to 0032025
2017-07-01 13:59 Marco van de Voort Relationship added duplicate of 0032025
2017-07-01 14:00 Marco van de Voort Note Added: 0101403
2017-07-01 14:00 Marco van de Voort Status new => resolved
2017-07-01 14:00 Marco van de Voort Resolution open => fixed
2017-07-01 14:00 Marco van de Voort Assigned To => Marco van de Voort
2017-07-01 14:00 Marco van de Voort Resolution fixed => duplicate
2017-07-24 20:41 Valdas Jankūnas Status resolved => closed