message: Add checking for number of inputs in GetOptionalInputTensor to avoid indexing out of array bounds.
diff: @@ -77,7 +77,8 @@ inline int64_t NumElements(const TfLiteTensor* t) {
  inline const TfLiteTensor* GetOptionalInputTensor(TfLiteContext* context,
  const TfLiteNode* node,
  int index) {
  - const bool use_tensor = node->inputs->data[index] != kTfLiteOptionalTensor;
  + const bool use_tensor = index < node->inputs->size &&
  + node->inputs->data[index] != kTfLiteOptionalTensor;
  if (use_tensor) {
  return &context
  ->tensors[flatbuffers::EndianScalar(node->inputs->data[index])];
  