From 85f08fa1d0cd99f88513c148fefd2f4086a137ec Mon Sep 17 00:00:00 2001 From: Larry Gritz Date: Sat, 25 Jun 2022 07:20:07 -0700 Subject: [PATCH] Fix crash when ioproxy is passed to a plugin that doesn't support it (#3453) The plugin was freed before the error message printed that depends on it. --- src/libOpenImageIO/imageioplugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libOpenImageIO/imageioplugin.cpp b/src/libOpenImageIO/imageioplugin.cpp index 5c53f37c29..61368a65a7 100644 --- a/src/libOpenImageIO/imageioplugin.cpp +++ b/src/libOpenImageIO/imageioplugin.cpp @@ -565,10 +565,10 @@ ImageOutput::create(string_view filename, Filesystem::IOProxy* ioproxy, } if (out && ioproxy) { if (!out->supports("ioproxy")) { - out.reset(); OIIO::pvt::errorfmt( "ImageOutput::create called with IOProxy, but format {} does not support IOProxy", out->format_name()); + out.reset(); } else { out->set_ioproxy(ioproxy); }