Skip to content

Commit 182adf6

Browse files
committed
tiff: declare var at begin of block
1 parent c7dfe20 commit 182adf6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/libImaging/TiffDecode.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -527,21 +527,21 @@ int ImagingLibTiffMergeFieldInfo(ImagingCodecState state, TIFFDataType field_typ
527527
// custom fields added with ImagingLibTiffMergeFieldInfo are only used for
528528
// decoding, ignore read_count;
529529
int read_count = 0;
530-
531530
// we support writing single value, or a variable number of values
532531
int write_count = 1;
532+
// whether the first value should encode the number of values.
533+
int passcount = 0;
534+
535+
TIFFFieldInfo info[1];
536+
533537
if (is_var_length) {
534538
write_count = -1;
535539
}
536540

537-
// whether the first value should encode the number of values.
538-
int passcount = 0;
539541
if (is_var_length && field_type != TIFF_ASCII) {
540542
passcount = 1;
541543
}
542-
const TIFFFieldInfo info[] = {
543-
{ key, read_count, write_count, field_type, FIELD_CUSTOM, 1, passcount, field_name }
544-
};
544+
info[0] = (TIFFFieldInfo) { key, read_count, write_count, field_type, FIELD_CUSTOM, 1, passcount, field_name };
545545
n = sizeof(info) / sizeof(info[0]);
546546

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

0 commit comments

Comments
 (0)