Bug 2751 - TIFFFetchNormalTag should not assert for custom tags
: TIFFFetchNormalTag should not assert for custom tags
Status: RESOLVED LATER
: libtiff
default
: unspecified
: PC other
: P2 major
: ---
Assigned To:
:
:
: migrated_to_gitlab
:
:
  Show dependency treegraph
 
Reported: 2017-12-01 09:55 by
Modified: 2019-10-01 14:20 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2017-12-01 09:55:24
I am using libtiff 4.0.6, and I have defined custom tags with the field_type
TIFF_SSHORT.

When I now read files with this tag, the function TIFFFetchNormalTag reaches
the default case with the line

assert(0);    /* we should never get here */

.

This is very disturbing during debugging my project, because I frequently want
to read a list of TIFF files and the assert gets me the following dialog:

    ---------------------------
    Microsoft Visual C++ Debug Library
    ---------------------------

    Assertion failed!

    Program: L:\jdk1.6.0_21_x64\bin\javaw.exe
    File: L:\tiff-4.0.6\libtiff\tif_dirread.c
    Line: 5354

    Expression: 0

    (Press Retry to debug the application)
    ---------------------------
    Abort Retry Ignore
    ---------------------------


The TIFFFieldInfo of my custom tag is:
{37023,-1,-1,TIFF_SSHORT,FIELD_CUSTOM, 1,1, "ProcessStatus"}

This causes set_field_type to become TIFF_SETGET_C16_SINT16, which is not
listed in TIFFFetchNormalTag, so I assume that reaching the default case is
correct. Is it?

I don't want to suppress the assertion by using a release build of libtiff,
because I want to debug how my custom tags are processed internally.
------- Comment #1 From 2019-04-25 08:25:59 -------
do you reproduce with latest version (4.0.10 or master from gitlab
https://gitlab.com/libtiff/libtiff ) ?
------- Comment #2 From 2019-10-01 14:20:49 -------
Bugzilla is no longer used for tracking libtiff issues. Remaining open tickets,
such as this one, have been migrated to the libtiff GitLab instance at
https://gitlab.com/libtiff/libtiff/issues .

The migrated tickets have their summary prefixed with [BZ#XXXX] where XXXX is
the initial Bugzilla issue number.