diff options
author | Andy Shaw <andy.shaw@qt.io> | 2019-02-04 18:50:23 +0100 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2019-02-05 16:05:30 +0000 |
commit | 43d70a6b02f14b7febfd9419bdd707d07e1eaf60 (patch) | |
tree | bd59abb289d965908a79f0ec1b1b27e4fa4dacdb /src/3rdparty | |
parent | 3c68eeac236b2e33cf34d2f23e04a8d156118eb0 (diff) |
assimp: Fix warning about uninitalized variable
Since the variable is initialized right afterwards and code elsewhere
indicates that it is valid to do this check still, the initialization
should be moved to account for it.
Change-Id: Id1d48329c38a2061661404dfb73656bf201e552d
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/3rdparty')
-rw-r--r-- | src/3rdparty/assimp/contrib/zip/src/miniz.h | 7 | ||||
-rw-r--r-- | src/3rdparty/patches/0007-assimp-Fix-warning-about-uninitalized-variable.patch | 24 |
2 files changed, 28 insertions, 3 deletions
diff --git a/src/3rdparty/assimp/contrib/zip/src/miniz.h b/src/3rdparty/assimp/contrib/zip/src/miniz.h index 916fb1ff8..2e4e223da 100644 --- a/src/3rdparty/assimp/contrib/zip/src/miniz.h +++ b/src/3rdparty/assimp/contrib/zip/src/miniz.h @@ -4427,14 +4427,15 @@ mz_bool mz_zip_writer_add_file(mz_zip_archive *pZip, const char *pArchive_name, mz_uint8 local_dir_header[MZ_ZIP_LOCAL_DIR_HEADER_SIZE]; MZ_FILE *pSrc_file = NULL; + if ((int)level_and_flags < 0) + level_and_flags = MZ_DEFAULT_LEVEL; + level = level_and_flags & 0xF; + if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || (!pArchive_name) || ((comment_size) && (!pComment)) || (level > MZ_UBER_COMPRESSION)) return MZ_FALSE; local_dir_header_ofs = cur_archive_file_ofs = pZip->m_archive_size; - if ((int)level_and_flags < 0) - level_and_flags = MZ_DEFAULT_LEVEL; - level = level_and_flags & 0xF; if (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA) return MZ_FALSE; diff --git a/src/3rdparty/patches/0007-assimp-Fix-warning-about-uninitalized-variable.patch b/src/3rdparty/patches/0007-assimp-Fix-warning-about-uninitalized-variable.patch new file mode 100644 index 000000000..056237f4c --- /dev/null +++ b/src/3rdparty/patches/0007-assimp-Fix-warning-about-uninitalized-variable.patch @@ -0,0 +1,24 @@ +diff --git a/src/3rdparty/assimp/contrib/zip/src/miniz.h b/src/3rdparty/assimp/contrib/zip/src/miniz.h +index 916fb1ff8..2e4e223da 100644 +--- a/src/3rdparty/assimp/contrib/zip/src/miniz.h ++++ b/src/3rdparty/assimp/contrib/zip/src/miniz.h +@@ -4427,14 +4427,15 @@ mz_bool mz_zip_writer_add_file(mz_zip_archive *pZip, const char *pArchive_name, + mz_uint8 local_dir_header[MZ_ZIP_LOCAL_DIR_HEADER_SIZE]; + MZ_FILE *pSrc_file = NULL; + ++ if ((int)level_and_flags < 0) ++ level_and_flags = MZ_DEFAULT_LEVEL; ++ level = level_and_flags & 0xF; ++ + if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || (!pArchive_name) || ((comment_size) && (!pComment)) || (level > MZ_UBER_COMPRESSION)) + return MZ_FALSE; + + local_dir_header_ofs = cur_archive_file_ofs = pZip->m_archive_size; + +- if ((int)level_and_flags < 0) +- level_and_flags = MZ_DEFAULT_LEVEL; +- level = level_and_flags & 0xF; + + if (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA) + return MZ_FALSE; + |