diff --git a/src/examples/ImageScaleDown.cpp b/src/examples/ImageScaleDown.cpp index 81928d03..6ef31c64 100644 --- a/src/examples/ImageScaleDown.cpp +++ b/src/examples/ImageScaleDown.cpp @@ -40,8 +40,9 @@ void tvgDrawCmds(tvg::Canvas* canvas) cout << "The PNG file is not loaded correctly. Did you enable PNG Loader?" << endl; return; } - if (canvas->push(move(picture)) == tvg::Result::Success) { - pPicture = picture.get(); + pPicture = picture.get(); + if (canvas->push(move(picture)) != tvg::Result::Success) { + pPicture = nullptr; } } diff --git a/src/examples/ImageScaleUp.cpp b/src/examples/ImageScaleUp.cpp index f45b96ca..45c6d8b5 100644 --- a/src/examples/ImageScaleUp.cpp +++ b/src/examples/ImageScaleUp.cpp @@ -40,8 +40,9 @@ void tvgDrawCmds(tvg::Canvas* canvas) cout << "The PNG file is not loaded correctly. Did you enable PNG Loader?" << endl; return; } - if (canvas->push(move(picture)) == tvg::Result::Success) { - pPicture = picture.get(); + pPicture = picture.get(); + if (canvas->push(move(picture)) != tvg::Result::Success) { + pPicture = nullptr; } }