Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fix OOB read issue with tf.raw_ops.CTCLoss.
PiperOrigin-RevId: 372242187
Change-Id: I347228ed8c04e1d2eb9d2479ae52f51d1b512c6e
  • Loading branch information
Amit Patankar authored and tensorflower-gardener committed May 6, 2021
1 parent d4286eb commit 4504a08
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tensorflow/core/kernels/ctc_loss_op.cc
Expand Up @@ -100,6 +100,10 @@ class CTCLossOp : public OpKernel {
errors::InvalidArgument("sequence_length is not a vector"));
OP_REQUIRES(ctx, TensorShapeUtils::IsMatrix(labels_indices->shape()),
errors::InvalidArgument("labels_indices is not a matrix"));
OP_REQUIRES(ctx, labels_indices->dim_size(1) > 1,
errors::InvalidArgument(
"labels_indices second dimension must be >= 1. Received ",
labels_indices->dim_size(1)));
OP_REQUIRES(ctx, TensorShapeUtils::IsVector(labels_values->shape()),
errors::InvalidArgument("labels_values is not a vector"));

Expand Down

0 comments on commit 4504a08

Please sign in to comment.