View Issue Details

IDProjectCategoryView StatusLast Update
0016767LazarusLCLpublic2010-07-07 17:25
ReporterJosé MejutoAssigned ToPaul Ishenin 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformi386OSWindowsOS VersionXP SP2
Product Version0.9.29 (SVN)Product Build25980 
Target Version0.9.30Fixed in Version0.9.29 (SVN) 
Summary0016767: jpeg format autodetect wrong endian
Descriptionjpeg autodetection checks against SOI but the check value is not endian safe and by default incorrect in x86
Steps To ReproduceTry to load a jpeg from a TMemoryStream.
Additional InformationPatch attached and very easy :)
TagsNo tags attached.
Fixed in Revision26495
LazTarget0.9.30
WidgetsetWin32/Win64
Attached Files
  • jpeg_detect.patch (361 bytes)
    Index: jpegimage.inc
    ===================================================================
    --- jpegimage.inc	(revision 25980)
    +++ jpegimage.inc	(working copy)
    @@ -37,7 +37,7 @@
       Pos := Stream.Position;
       try
         Stream.Read(SOI, SizeOf(SOI));
    -    Result := SOI = $FFD8;
    +    Result := SOI = NtoLE($D8FF);
       finally
         Stream.Position := Pos;
       end;
    
    jpeg_detect.patch (361 bytes)

Activities

2010-06-21 00:43

 

jpeg_detect.patch (361 bytes)
Index: jpegimage.inc
===================================================================
--- jpegimage.inc	(revision 25980)
+++ jpegimage.inc	(working copy)
@@ -37,7 +37,7 @@
   Pos := Stream.Position;
   try
     Stream.Read(SOI, SizeOf(SOI));
-    Result := SOI = $FFD8;
+    Result := SOI = NtoLE($D8FF);
   finally
     Stream.Position := Pos;
   end;
jpeg_detect.patch (361 bytes)

Paul Ishenin

2010-07-07 13:40

manager   ~0039105

Thanks, applied. Please close if ok.

Issue History

Date Modified Username Field Change
2010-06-21 00:43 José Mejuto New Issue
2010-06-21 00:43 José Mejuto File Added: jpeg_detect.patch
2010-06-21 00:43 José Mejuto Widgetset => Win32/Win64
2010-06-21 13:54 Vincent Snijders LazTarget => 0.9.30
2010-06-21 13:54 Vincent Snijders Status new => acknowledged
2010-06-21 13:54 Vincent Snijders Target Version => 0.9.30
2010-07-07 13:40 Paul Ishenin Fixed in Revision => 26495
2010-07-07 13:40 Paul Ishenin Status acknowledged => resolved
2010-07-07 13:40 Paul Ishenin Fixed in Version => 0.9.29 (SVN)
2010-07-07 13:40 Paul Ishenin Resolution open => fixed
2010-07-07 13:40 Paul Ishenin Assigned To => Paul Ishenin
2010-07-07 13:40 Paul Ishenin Note Added: 0039105
2010-07-07 17:25 José Mejuto Status resolved => closed