message: In case of error in `DecodePng`, end kernel execution immediately.
  There are scenarios where we detect an error in `DecodePng` kernel, yet the execution continues for a while longer before an error is thrown. This is not safe.
diff: @@ -346,15 +346,18 @@ class DecodeImageV2Op : public OpKernel {
  }
  Tensor* output = nullptr;
  - Status status;
  // By the existing API, we support decoding PNG with `DecodeGif` op.
  // We need to make sure to return 4-D shapes when using `DecodeGif`.
  if (op_type_ == "DecodeGif") {
  - status = context->allocate_output(
  - 0, TensorShape({1, height, width, decode.channels}), &output);
  + OP_REQUIRES_OK(
  + context,
  + context->allocate_output(
  + 0, TensorShape({1, height, width, decode.channels}), &output));
  } else {
  - status = context->allocate_output(
  - 0, TensorShape({height, width, decode.channels}), &output);
  + OP_REQUIRES_OK(
  + context,
  + context->allocate_output(
  + 0, TensorShape({height, width, decode.channels}), &output));
  }
  if (op_type_ == "DecodeBmp") {
  @@ -374,9 +377,6 @@ class DecodeImageV2Op : public OpKernel {
  "detected PNG."));
  }
  - if (!status.ok()) png::CommonFreeDecode(&decode);
  - OP_REQUIRES_OK(context, status);
  -
  if (data_type_ == DataType::DT_UINT8) {
  OP_REQUIRES(
  context,
  