Skip to content

Commit

Permalink
Bugfix: unchecked pointer use
Browse files Browse the repository at this point in the history
  • Loading branch information
k-melnik committed Dec 26, 2024
1 parent 87d5152 commit 07e3570
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tensorflow/lite/micro/micro_allocator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,8 @@ TfLiteTensor* MicroAllocator::AllocateTempTfLiteTensor(
// Populate any fields from the flatbuffer, since this TfLiteTensor struct is
// allocated in the temp section of the arena, ensure that additional
// allocations also take place in that section of the arena.
if (PopulateTfLiteTensorFromFlatbuffer(model, tensor, tensor_index,
if (nullptr == tensor ||
PopulateTfLiteTensorFromFlatbuffer(model, tensor, tensor_index,
subgraph_index,
/*allocate_temp=*/true) != kTfLiteOk) {
MicroPrintf(
Expand Down

0 comments on commit 07e3570

Please sign in to comment.