Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory corruption issue with tf.raw_ops.DrawBoundingBoxesV2. #49645

Merged
merged 1 commit into from May 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions tensorflow/core/kernels/image/draw_bounding_box_op.cc
Expand Up @@ -73,6 +73,12 @@ class DrawBoundingBoxesOp : public OpKernel {
errors::InvalidArgument("Channel depth should be either 1 (GRY), "
"3 (RGB), or 4 (RGBA)"));

OP_REQUIRES(
context, boxes.dim_size(2) == 4,
errors::InvalidArgument(
"The size of the third dimension of the box must be 4. Received: ",
boxes.dim_size(2)));

const int64 batch_size = images.dim_size(0);
const int64 height = images.dim_size(1);
const int64 width = images.dim_size(2);
Expand Down