mirror of
https://github.com/zebrajr/tensorflow.git
synced 2026-01-15 12:15:41 +00:00
Merge pull request #49763 from geetachavan1/cherrypicks_50B03
Prevent infinite loop/stack overflow in TFLite `while` op.
This commit is contained in:
@@ -132,6 +132,8 @@ TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
|
||||
auto* subgraphs = this_subgraph->GetSubgraphs();
|
||||
TF_LITE_ENSURE(context, op_data->cond_subgraph_index < subgraphs->size());
|
||||
TF_LITE_ENSURE(context, op_data->body_subgraph_index < subgraphs->size());
|
||||
TF_LITE_ENSURE(context,
|
||||
op_data->cond_subgraph_index != op_data->body_subgraph_index);
|
||||
|
||||
Subgraph* cond_subgraph = (*subgraphs)[op_data->cond_subgraph_index].get();
|
||||
Subgraph* body_subgraph = (*subgraphs)[op_data->body_subgraph_index].get();
|
||||
|
||||
Reference in New Issue
Block a user