Skip to content

Commit

Permalink
error checking for FSE_buildDTable. issue #921 (#163)
Browse files Browse the repository at this point in the history
* error checking for FSE_buildDTable. issue #921

* temp test

* fix error lookup

* remove test
  • Loading branch information
wjblanke authored Feb 17, 2021
1 parent 31f38eb commit 5f0635b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/encoding.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include "../lib/FiniteStateEntropy/lib/fse.h"
#include "../lib/FiniteStateEntropy/lib/hist.h"
#include "../lib/FiniteStateEntropy/lib/error_public.h"
#include "bits.hpp"
#include "exceptions.hpp"
#include "util.hpp"
Expand Down Expand Up @@ -164,7 +165,9 @@ class Encoding {
unsigned tableLog = 14;

FSE_DTable *dt = FSE_createDTable(tableLog);
FSE_buildDTable(dt, nCount.data(), maxSymbolValue, tableLog);
size_t err = FSE_buildDTable(dt, nCount.data(), maxSymbolValue, tableLog);
if(err != FSE_error_no_error)
throw std::logic_error("FSE_buildDTable failed");
DT_MEMO[R] = dt;
}

Expand Down

0 comments on commit 5f0635b

Please sign in to comment.