Browse Source

!14753 Codec fix, nullptr isn't checked after a dynamic cast

From: @ziruiwu
Reviewed-by: @pandoublefeng,@robingrosman
Signed-off-by: @pandoublefeng
tags/v1.2.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
384fafd3f2
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      mindspore/ccsrc/minddata/dataset/engine/opt/optional/tensor_op_fusion_pass.cc

+ 1
- 0
mindspore/ccsrc/minddata/dataset/engine/opt/optional/tensor_op_fusion_pass.cc View File

@@ -39,6 +39,7 @@ Status TensorOpFusionPass::Visit(std::shared_ptr<MapNode> node, bool *const modi
if (itr != ops.end()) {
MS_LOG(WARNING) << "Fusing pre-build Decode and RandomCropResize into one pre-build.";
auto op = dynamic_cast<RandomCropAndResizeOp *>((*(itr + 1))->Build().get());
RETURN_UNEXPECTED_IF_NULL(op);
(*itr) = std::make_shared<transforms::PreBuiltOperation>(std::make_shared<RandomCropDecodeResizeOp>(*op));
ops.erase(itr + 1);
node->setOperations(ops);


Loading…
Cancel
Save