Skip to content

Commit

Permalink
Prevent a division by 0
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 371007407
Change-Id: Iecf2718de48d6bf5a69b02a9df9deda8ec1b19d3
  • Loading branch information
mihaimaruseac authored and tensorflower-gardener committed Apr 28, 2021
1 parent ba6822b commit 5117e08
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tensorflow/lite/kernels/hashtable_lookup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, 2, &value));

const int num_rows = SizeOfDimension(value, 0);
TF_LITE_ENSURE(context, num_rows != 0);
const int row_bytes = value->bytes / num_rows;
void* pointer = nullptr;
DynamicBuffer buf;
Expand Down

0 comments on commit 5117e08

Please sign in to comment.