Skip to content

Commit 57d07fe

Browse files
committed
Check the filter size of each filter
Signed-off-by: Xiaoxia Liang <xiaoxia.liang@intel.com>
1 parent 27e8806 commit 57d07fe

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Library/Raisr.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,12 @@ static RNLERRORTYPE ReadTrainedData(std::string hashtablePath, std::string QStrP
294294
std::istringstream new_iss(line);
295295
std::vector<std::string> new_tokens{std::istream_iterator<std::string>{new_iss},
296296
std::istream_iterator<std::string>{}};
297+
298+
if (new_tokens.size() != gPatchSize * gPatchSize) {
299+
std::cout << "[RAISR ERROR] hashtable corrupted: " << hashtablePath << std::endl;
300+
return RNLErrorBadParameter;
301+
}
302+
297303
float *currentfilter = &AFilters[num * aligned_rows];
298304

299305
for (const auto &value : new_tokens)

0 commit comments

Comments
 (0)