#226 Value of tiff metadata tag (type ASCII) is truncated when tag is of variable length

None
closed
Hervé Drolon
None
5
2014-03-23
2013-05-09
Marko Vončina
No

When metadata tag is of type ASCII and it's value is of variable size (TIFF_VARIABLE) this function gives length of 1 so all strings are truncated.

The code should determine the actual string length.

function tiff_read_exif_tag
...
if (fip->field_readcount == TIFF_VARIABLE || fip->field_readcount == TIFF_VARIABLE2)
value_count = 1;
...
default: {
// remember that raw_data = _TIFFmalloc(value_size * value_count);
const int value_size = _TIFFDataSize(fip->field_type); <<<< PROBLEM
size_t length = value_size * value_count;
...

Discussion

  • Hervé Drolon
    Hervé Drolon
    2013-05-12

    • status: open --> pending
    • assigned_to: Hervé Drolon
    • Group: -->
     
  • Hervé Drolon
    Hervé Drolon
    2013-05-12

    Hi,

    Thanks for the bug report. It is now fixed in the CVS.

    Hervé

     
  • Hervé Drolon
    Hervé Drolon
    2014-03-23

    • status: pending --> closed
     
  • Hervé Drolon
    Hervé Drolon
    2014-03-23

    fixed in release 3.16.0