From 27538eeb2ecbec01820b33f9344f65aed63d75fc Mon Sep 17 00:00:00 2001 From: krcroft Date: Fri, 6 Mar 2020 12:47:00 -0800 Subject: [PATCH] Update the existing PVS false-positives for xxHash v0.7.3 --- .pvs-suppress | 8 ++++---- src/libs/decoders/mp3_seek_table.cpp | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.pvs-suppress b/.pvs-suppress index 92f28451..4a3c8c05 100644 --- a/.pvs-suppress +++ b/.pvs-suppress @@ -6,7 +6,7 @@ "CodeNext": 355817, "CodePrev": 1212132082, "ErrorCode": "V512", - "FileName": "xxhash.c", + "FileName": "xxhash.h", "Message": "A call of the 'memcpy' function will lead to underflow of the buffer 'statePtr'." }, { @@ -14,7 +14,7 @@ "CodeNext": 355817, "CodePrev": 1212132082, "ErrorCode": "V512", - "FileName": "xxhash.c", + "FileName": "xxhash.h", "Message": "A call of the 'memcpy' function will lead to underflow of the buffer '& state'." }, { @@ -22,7 +22,7 @@ "CodeNext": 355817, "CodePrev": 1162686117, "ErrorCode": "V512", - "FileName": "xxhash.c", + "FileName": "xxhash.h", "Message": "A call of the 'memcpy' function will lead to underflow of the buffer 'statePtr'." }, { @@ -30,7 +30,7 @@ "CodeNext": 355817, "CodePrev": 1162686117, "ErrorCode": "V512", - "FileName": "xxhash.c", + "FileName": "xxhash.h", "Message": "A call of the 'memcpy' function will lead to underflow of the buffer '& state'." }, { diff --git a/src/libs/decoders/mp3_seek_table.cpp b/src/libs/decoders/mp3_seek_table.cpp index 6d9de3c0..0ace00ce 100644 --- a/src/libs/decoders/mp3_seek_table.cpp +++ b/src/libs/decoders/mp3_seek_table.cpp @@ -150,6 +150,10 @@ Uint64 calculate_stream_hash(struct SDL_RWops* const context) { // have the same trailing 32KB of content. The different seeds will produce // unique hashes. XXH64_state_t* const state = XXH64_createState(); + if(!state) { + return 0; + } + const uint64_t seed = static_cast(stream_size); XXH64_reset(state, seed);