Skip to content

Commit

Permalink
check depth before asserting type mismatch as is done in likely_read
Browse files Browse the repository at this point in the history
  • Loading branch information
jklontz committed Jun 24, 2016
1 parent 5f6bef6 commit 338e614
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/io.cpp
Expand Up @@ -248,7 +248,7 @@ likely_mat likely_decode(likely_const_mat buffer, likely_type type)
} catch (...) {}

likely_ensure(result != NULL, "decode failure");
if (result && (result->type != type)) {
if (result && (type & likely_depth) && (result->type != type)) {
likely_release_mat(result);
result = NULL;
likely_ensure(false, "decode type mismatch");
Expand Down

0 comments on commit 338e614

Please sign in to comment.