Browse Source

- inverted order of check to improve performance

development
Andreas Romeyke 10 months ago
parent
commit
bb49e05ae3
  1. 21
      src/ifdrules/check_all_IFDs_are_word_aligned.c

21
src/ifdrules/check_all_IFDs_are_word_aligned.c

@ -18,15 +18,16 @@ ret_t check_all_IFDs_are_word_aligned(ctiff_t * ctif) {
TIFP_CHECK( ctif, ret);
uint32 ifd = get_ifd0_pos( ctif ); /* TODO: check all other IFDs, too */
if ( 0 != (ifd & 1)) {
// FIXME: tif_fails?
char array[VALUESTRLEN];
snprintf(array, sizeof(array), "offset of first IFD points to 0x%08x and is not word-aligned", ifd);
ret = set_value_found_ret (&ret, array);
ret.returncode = ifderror_offset_not_word_aligned;
return ret;
}
ret.returncode=is_valid;
return ret;
if (0 == (ifd & 1)) {
ret.returncode = is_valid;
return ret;
} else {
// FIXME: tif_fails?
char array[VALUESTRLEN];
snprintf(array, sizeof(array), "offset of first IFD points to 0x%08x and is not word-aligned", ifd);
ret = set_value_found_ret(&ret, array);
ret.returncode = ifderror_offset_not_word_aligned;
return ret;
}
}
/* vim: set tabstop=2 softtabstop=2 shiftwidth=2 smarttab expandtab :*/
Loading…
Cancel
Save