diff options
Diffstat (limited to 'Utilities/cmliblzma/liblzma/check/check.c')
-rw-r--r-- | Utilities/cmliblzma/liblzma/check/check.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Utilities/cmliblzma/liblzma/check/check.c b/Utilities/cmliblzma/liblzma/check/check.c index 428ddaeb77..979b0a8180 100644 --- a/Utilities/cmliblzma/liblzma/check/check.c +++ b/Utilities/cmliblzma/liblzma/check/check.c @@ -16,9 +16,6 @@ extern LZMA_API(lzma_bool) lzma_check_is_supported(lzma_check type) { - if ((unsigned int)(type) > LZMA_CHECK_ID_MAX) - return false; - static const lzma_bool available_checks[LZMA_CHECK_ID_MAX + 1] = { true, // LZMA_CHECK_NONE @@ -56,6 +53,9 @@ lzma_check_is_supported(lzma_check type) false, // Reserved }; + if ((unsigned int)(type) > LZMA_CHECK_ID_MAX) + return false; + return available_checks[(unsigned int)(type)]; } @@ -63,9 +63,6 @@ lzma_check_is_supported(lzma_check type) extern LZMA_API(uint32_t) lzma_check_size(lzma_check type) { - if ((unsigned int)(type) > LZMA_CHECK_ID_MAX) - return UINT32_MAX; - // See file-format.txt section 2.1.1.2. static const uint8_t check_sizes[LZMA_CHECK_ID_MAX + 1] = { 0, @@ -76,6 +73,9 @@ lzma_check_size(lzma_check type) 64, 64, 64 }; + if ((unsigned int)(type) > LZMA_CHECK_ID_MAX) + return UINT32_MAX; + return check_sizes[(unsigned int)(type)]; } |