Skip to content

Commit

Permalink
Merge pull request #49639 from geetachavan1/cherrypicks_UQHQ8
Browse files Browse the repository at this point in the history
Fix out of bound read in requantization_range_op.cc
  • Loading branch information
mihaimaruseac committed May 26, 2021
2 parents 618d47b + 5c60afa commit cfc56ca
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tensorflow/core/kernels/requantization_range_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit cfc56ca

Please sign in to comment.