"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "gpsinfo.c" between
jhead-3.03.tar.gz and jhead-3.04.tar.gz

About: jhead is an Exif Jpeg header and thumbnail manipulation tool.

gpsinfo.c  (jhead-3.03):gpsinfo.c  (jhead-3.04)
skipping to change at line 102 skipping to change at line 102
continue; continue;
} }
ComponentSize = BytesPerFormat[Format]; ComponentSize = BytesPerFormat[Format];
ByteCount = Components * ComponentSize; ByteCount = Components * ComponentSize;
if (ByteCount > 4){ if (ByteCount > 4){
unsigned OffsetVal; unsigned OffsetVal;
OffsetVal = Get32u(DirEntry+8); OffsetVal = Get32u(DirEntry+8);
// If its bigger than 4 bytes, the dir entry contains an offset. // If its bigger than 4 bytes, the dir entry contains an offset.
if (OffsetVal+ByteCount > ExifLength){ if (OffsetVal > 0x1000000 || OffsetVal+ByteCount > ExifLength){
// Max exif in jpeg is 64k, so any offset bigger than that is bo
gus.
// Bogus pointer offset and / or bytecount value // Bogus pointer offset and / or bytecount value
ErrNonfatal("Illegal value pointer for Exif gps tag %04x", Tag,0 ); ErrNonfatal("Illegal value pointer for Exif gps tag %04x", Tag,0 );
continue; continue;
} }
ValuePtr = OffsetBase+OffsetVal; ValuePtr = OffsetBase+OffsetVal;
}else{ }else{
// 4 bytes or less and value is in the dir entry itself // 4 bytes or less and value is in the dir entry itself
ValuePtr = DirEntry+8; ValuePtr = DirEntry+8;
} }
skipping to change at line 148 skipping to change at line 149
den = den / 10; den = den / 10;
digits += 1; digits += 1;
} }
if (digits > 6) digits = 6; if (digits > 6) digits = 6;
FmtString[1+a*7] = (char)('2'+digits+(digits ? 1 : 0)); FmtString[1+a*7] = (char)('2'+digits+(digits ? 1 : 0));
FmtString[3+a*7] = (char)('0'+digits); FmtString[3+a*7] = (char)('0'+digits);
Values[a] = ConvertAnyFormat(ValuePtr+a*ComponentSize, Forma t); Values[a] = ConvertAnyFormat(ValuePtr+a*ComponentSize, Forma t);
} }
sprintf(TempString, FmtString, Values[0], Values[1], Values[2]); snprintf(TempString, sizeof(TempString), FmtString, Values[0], V alues[1], Values[2]);
if (Tag == TAG_GPS_LAT){ if (Tag == TAG_GPS_LAT){
strncpy(ImageInfo.GpsLat+2, TempString, 29); strncpy(ImageInfo.GpsLat+2, TempString, 29);
}else{ }else{
strncpy(ImageInfo.GpsLong+2, TempString, 29); strncpy(ImageInfo.GpsLong+2, TempString, 29);
} }
break; break;
case TAG_GPS_ALT_REF: case TAG_GPS_ALT_REF:
ImageInfo.GpsAlt[0] = (char)(ValuePtr[0] ? '-' : ' '); ImageInfo.GpsAlt[0] = (char)(ValuePtr[0] ? '-' : ' ');
break; break;
case TAG_GPS_ALT: case TAG_GPS_ALT:
sprintf(ImageInfo.GpsAlt + 1, "%.2fm", snprintf(ImageInfo.GpsAlt+1, sizeof(ImageInfo.GpsAlt)-1,
ConvertAnyFormat(ValuePtr, Format)); "%.2fm", ConvertAnyFormat(ValuePtr, Format));
break; break;
} }
if (ShowTags){ if (ShowTags){
// Show tag value. // Show tag value.
if (Tag < MAX_GPS_TAG){ if (Tag < MAX_GPS_TAG){
printf(" GPS%s =", GpsTags[Tag]); printf(" GPS%s =", GpsTags[Tag]);
}else{ }else{
// Show unknown tag // Show unknown tag
printf(" Illegal GPS tag %04x=", Tag); printf(" Illegal GPS tag %04x=", Tag);
 End of changes. 3 change blocks. 
4 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)