Browse Source

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

tags/v1.2.0
Zirui Wu 5 years ago
parent
commit
f275563333
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