From 182adf62357797782082640244d23ec3fe4a9ae9 Mon Sep 17 00:00:00 2001 From: Oliver Tonnhofer Date: Mon, 3 Jun 2019 12:47:38 +0200 Subject: [PATCH] tiff: declare var at begin of block --- src/libImaging/TiffDecode.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libImaging/TiffDecode.c b/src/libImaging/TiffDecode.c index 4f36e6e93d5..e188b890d20 100644 --- a/src/libImaging/TiffDecode.c +++ b/src/libImaging/TiffDecode.c @@ -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