Skip to content
Permalink
Browse files
Fix out of bound read in requantization_range_op.cc
PiperOrigin-RevId: 372129031
Change-Id: Ie684ab98a3840c5186ead3eafffc0e0ed0e8030d
  • Loading branch information
pak-laura authored and tensorflower-gardener committed May 5, 2021
1 parent ac328ea commit ef0c008ee84bad91ec6725ddc42091e19a30cf0e
Showing with 4 additions and 0 deletions.
  1. +4 −0 tensorflow/core/kernels/requantization_range_op.cc
@@ -46,6 +46,10 @@ class RequantizationRangeOp : public OpKernel {

void Compute(OpKernelContext* ctx) override {
const Tensor& input = ctx->input(0);
OP_REQUIRES(ctx, ctx->input(1).NumElements() > 0,
errors::InvalidArgument("Input min must not be empty."));
OP_REQUIRES(ctx, ctx->input(2).NumElements() > 0,
errors::InvalidArgument("Input max must not be empty."));
const float input_min_float = ctx->input(1).flat<float>()(0);
const float input_max_float = ctx->input(2).flat<float>()(0);
Tensor* output_min = nullptr;

0 comments on commit ef0c008

Please sign in to comment.