Skip to content

Commit

Permalink
tiff: declare var at begin of block
Browse files Browse the repository at this point in the history
  • Loading branch information
olt committed Jun 3, 2019
1 parent c7dfe20 commit 182adf6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/libImaging/TiffDecode.c
Expand Up @@ -527,21 +527,21 @@ int ImagingLibTiffMergeFieldInfo(ImagingCodecState state, TIFFDataType field_typ
// custom fields added with ImagingLibTiffMergeFieldInfo are only used for
// decoding, ignore read_count;
int read_count = 0;

// we support writing single value, or a variable number of values
int write_count = 1;
// whether the first value should encode the number of values.
int passcount = 0;

TIFFFieldInfo info[1];

if (is_var_length) {
write_count = -1;
}

// whether the first value should encode the number of values.
int passcount = 0;
if (is_var_length && field_type != TIFF_ASCII) {
passcount = 1;
}
const TIFFFieldInfo info[] = {
{ key, read_count, write_count, field_type, FIELD_CUSTOM, 1, passcount, field_name }
};
info[0] = (TIFFFieldInfo) { key, read_count, write_count, field_type, FIELD_CUSTOM, 1, passcount, field_name };
n = sizeof(info) / sizeof(info[0]);

// Test for libtiff 4.0 or later, excluding libtiff 3.9.6 and 3.9.7
Expand Down

0 comments on commit 182adf6

Please sign in to comment.