diff options
-rw-r--r-- | tensorflow/core/kernels/resize_bicubic_op.cc | 5 | ||||
-rw-r--r-- | tensorflow/core/kernels/resize_bilinear_op.cc | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/tensorflow/core/kernels/resize_bicubic_op.cc b/tensorflow/core/kernels/resize_bicubic_op.cc index fef4064e04..ea09c3be0c 100644 --- a/tensorflow/core/kernels/resize_bicubic_op.cc +++ b/tensorflow/core/kernels/resize_bicubic_op.cc @@ -63,6 +63,11 @@ class ResizeBicubicOp : public OpKernel { const int64 channels = input.dim_size(3); const int64 out_height = output->dim_size(1); const int64 out_width = output->dim_size(2); + CHECK_GT(in_height, 0); + CHECK_GT(in_width, 0); + CHECK_GT(channels, 0); + CHECK_GT(out_height, 0); + CHECK_GT(out_width, 0); typename TTypes<T, 4>::ConstTensor input_data = input.tensor<T, 4>(); typename TTypes<float, 4>::Tensor output_data = output->tensor<float, 4>(); diff --git a/tensorflow/core/kernels/resize_bilinear_op.cc b/tensorflow/core/kernels/resize_bilinear_op.cc index b3fa1a1777..1688be42f5 100644 --- a/tensorflow/core/kernels/resize_bilinear_op.cc +++ b/tensorflow/core/kernels/resize_bilinear_op.cc @@ -64,6 +64,11 @@ class ResizeBilinearOp : public OpKernel { const int64 channels = input.dim_size(3); const int64 out_height = output->dim_size(1); const int64 out_width = output->dim_size(2); + CHECK_GT(in_height, 0); + CHECK_GT(in_width, 0); + CHECK_GT(channels, 0); + CHECK_GT(out_height, 0); + CHECK_GT(out_width, 0); typename TTypes<T, 4>::ConstTensor input_data = input.tensor<T, 4>(); typename TTypes<float, 4>::Tensor output_data = output->tensor<float, 4>(); |