You've already forked lazarus-ccr
fpexif: Fix bug in Nikon maker note reader, caused crash for some Nikon images.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7347 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -49,6 +49,7 @@
|
|||||||
<Unit2>
|
<Unit2>
|
||||||
<Filename Value="..\..\fpemakernotesanyo.pas"/>
|
<Filename Value="..\..\fpemakernotesanyo.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
|
<UnitName Value="fpeMakerNoteSanyo"/>
|
||||||
</Unit2>
|
</Unit2>
|
||||||
</Units>
|
</Units>
|
||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
@ -62,6 +63,11 @@
|
|||||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||||
</SearchPaths>
|
</SearchPaths>
|
||||||
|
<CodeGeneration>
|
||||||
|
<Checks>
|
||||||
|
<RangeChecks Value="True"/>
|
||||||
|
</Checks>
|
||||||
|
</CodeGeneration>
|
||||||
<Linking>
|
<Linking>
|
||||||
<Debugging>
|
<Debugging>
|
||||||
<UseExternalDbgSyms Value="True"/>
|
<UseExternalDbgSyms Value="True"/>
|
||||||
|
@ -185,7 +185,7 @@ type
|
|||||||
private
|
private
|
||||||
FIndex: Integer;
|
FIndex: Integer;
|
||||||
public
|
public
|
||||||
constructor Create(ATagID, AIndex: Integer; AName: String; AData: TBytes;
|
constructor Create(ATagID: TTagID; AIndex: Integer; AName: String; AData: TBytes;
|
||||||
ACount: Integer; ALkupTbl: String; AOptions: TTagOptions); reintroduce;
|
ACount: Integer; ALkupTbl: String; AOptions: TTagOptions); reintroduce;
|
||||||
property Index: Integer read FIndex;
|
property Index: Integer read FIndex;
|
||||||
end;
|
end;
|
||||||
@ -194,7 +194,7 @@ type
|
|||||||
private
|
private
|
||||||
FIndex: Integer;
|
FIndex: Integer;
|
||||||
public
|
public
|
||||||
constructor Create(ATagID, AIndex: Integer; AName: String; AValue: Integer;
|
constructor Create(ATagID: TTagID; AIndex: Integer; AName: String; AValue: Integer;
|
||||||
ALkupTbl, AFormatStr: String; ATagType: TTagType; AOptions: TTagOptions); reintroduce;
|
ALkupTbl, AFormatStr: String; ATagType: TTagType; AOptions: TTagOptions); reintroduce;
|
||||||
property Index: Integer read FIndex;
|
property Index: Integer read FIndex;
|
||||||
end;
|
end;
|
||||||
@ -203,7 +203,7 @@ type
|
|||||||
private
|
private
|
||||||
FIndex: Integer;
|
FIndex: Integer;
|
||||||
public
|
public
|
||||||
constructor Create(ATagID, AIndex: Integer; AName: String; AValue: Double;
|
constructor Create(ATagID: TTagID; AIndex: Integer; AName: String; AValue: Double;
|
||||||
AFormatStr: String; ATagType: TTagType; AOptions: TTagOptions); reintroduce;
|
AFormatStr: String; ATagType: TTagType; AOptions: TTagOptions); reintroduce;
|
||||||
property Index: Integer read FIndex;
|
property Index: Integer read FIndex;
|
||||||
end;
|
end;
|
||||||
@ -1436,8 +1436,8 @@ end;
|
|||||||
//==============================================================================
|
//==============================================================================
|
||||||
// TMakerNoteTag
|
// TMakerNoteTag
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
constructor TMakerNoteIntegerTag.Create(ATagID, AIndex: Integer; AName: String;
|
constructor TMakerNoteIntegerTag.Create(ATagID: TTagID; AIndex: Integer;
|
||||||
AValue: Integer; ALkupTbl, AFormatStr: String; ATagType: TTagType;
|
AName: String; AValue: Integer; ALkupTbl, AFormatStr: String; ATagType: TTagType;
|
||||||
AOptions: TTagOptions);
|
AOptions: TTagOptions);
|
||||||
begin
|
begin
|
||||||
if not (ATagType in [ttUInt8, ttUInt16, ttUInt32, ttSInt8, ttSInt16, ttSInt32]) then
|
if not (ATagType in [ttUInt8, ttUInt16, ttUInt32, ttSInt8, ttSInt16, ttSInt32]) then
|
||||||
@ -1457,8 +1457,8 @@ begin
|
|||||||
SetInteger(0, AValue, false); // false: MakeNote tags are poorly defined -> don't crash
|
SetInteger(0, AValue, false); // false: MakeNote tags are poorly defined -> don't crash
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TMakerNoteFloatTag.Create(ATagID, AIndex: Integer; AName: String;
|
constructor TMakerNoteFloatTag.Create(ATagID: TTagID; AIndex: Integer;
|
||||||
AValue: Double; AFormatStr: String; ATagType: TTagType;
|
AName: String; AValue: Double; AFormatStr: String; ATagType: TTagType;
|
||||||
AOptions: TTagOptions);
|
AOptions: TTagOptions);
|
||||||
begin
|
begin
|
||||||
if not (ATagType in [ttURational, ttSRational]) then
|
if not (ATagType in [ttURational, ttSRational]) then
|
||||||
@ -1476,8 +1476,8 @@ begin
|
|||||||
AsFloat := AValue;
|
AsFloat := AValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TMakerNoteStringTag.Create(ATagID, AIndex: Integer; AName: String;
|
constructor TMakerNoteStringTag.Create(ATagID: TTagID; AIndex: Integer;
|
||||||
AData: TBytes; ACount: Integer; ALkupTbl: String;
|
AName: String; AData: TBytes; ACount: Integer; ALkupTbl: String;
|
||||||
AOptions: TTagOptions);
|
AOptions: TTagOptions);
|
||||||
begin
|
begin
|
||||||
FIndex := AIndex;
|
FIndex := AIndex;
|
||||||
|
@ -491,7 +491,7 @@ begin
|
|||||||
AClass, AReadOnly);
|
AClass, AReadOnly);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TTagDefList.AddURationalTag( ATagID: TTagID; AName: String;
|
procedure TTagDefList.AddURationalTag(ATagID: TTagID; AName: String;
|
||||||
ACount: Word = 1; ADesc: String = '';
|
ACount: Word = 1; ADesc: String = '';
|
||||||
ALkupTbl: String = ''; AFormatStr: String = ''; AClass: TTagClass = nil;
|
ALkupTbl: String = ''; AFormatStr: String = ''; AClass: TTagClass = nil;
|
||||||
AReadOnly: Boolean = false);
|
AReadOnly: Boolean = false);
|
||||||
@ -921,6 +921,7 @@ var
|
|||||||
s: String;
|
s: String;
|
||||||
fmtStr: TStringArray;
|
fmtStr: TStringArray;
|
||||||
lkup: TStringArray;
|
lkup: TStringArray;
|
||||||
|
len: Integer;
|
||||||
begin
|
begin
|
||||||
Result := '';
|
Result := '';
|
||||||
|
|
||||||
@ -941,7 +942,9 @@ begin
|
|||||||
for i:=0 to FCount-1 do lkup[i] := '';
|
for i:=0 to FCount-1 do lkup[i] := '';
|
||||||
end else begin
|
end else begin
|
||||||
lkup := Split(FLkUpTbl, '|');
|
lkup := Split(FLkUpTbl, '|');
|
||||||
for i:=Length(lkup) to FCount-1 do lkup[i] := '';
|
len := Length(lkup);
|
||||||
|
if len < FCount then SetLength(lkup, FCount);
|
||||||
|
for i:=len to FCount-1 do lkup[i] := '';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
for i:=0 to FCount-1 do begin
|
for i:=0 to FCount-1 do begin
|
||||||
|
Reference in New Issue
Block a user