Skip to content

Commit 07e3570

Browse files
committed
Bugfix: unchecked pointer use
1 parent 87d5152 commit 07e3570

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tensorflow/lite/micro/micro_allocator.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,8 @@ TfLiteTensor* MicroAllocator::AllocateTempTfLiteTensor(
875875
// Populate any fields from the flatbuffer, since this TfLiteTensor struct is
876876
// allocated in the temp section of the arena, ensure that additional
877877
// allocations also take place in that section of the arena.
878-
if (PopulateTfLiteTensorFromFlatbuffer(model, tensor, tensor_index,
878+
if (nullptr == tensor ||
879+
PopulateTfLiteTensorFromFlatbuffer(model, tensor, tensor_index,
879880
subgraph_index,
880881
/*allocate_temp=*/true) != kTfLiteOk) {
881882
MicroPrintf(

0 commit comments

Comments
 (0)