TImage DrawCircle cause core dump


Please read tips for efficient and successful posting and posting code

Please fill also the fields below. Note that root -b -q will tell you this info, and starting from 6.28/06 upwards, you can call .forum bug from the ROOT prompt to pre-populate a topic.

ROOT Version: 6.39.01 lastest master
Platform: macos

```cpp

static void show_pic() {

  TImage* img = TASImage::Open("aa.jpeg", TASImage::kJpeg);

  img->DrawCircle(10, 10, 3, "#FF0000", 1);
}

[/Users/cx/software/ROOT/install/lib/libASImage.so] TASImage::DrawCircle(int, int, int, char const*, int) (no debug info)
[/Users/cx/software/ROOT/install/lib/libASImage.so] TASImage::DrawCircle(int, int, int, char const*, int) (no debug info)
[/Users/cx/software/ROOT/install/lib/libCling.so] cling::IncrementalExecutor::executeWrapper(llvm::StringRef, cling::Value*) const (no debug info)
[/Users/cx/software/ROOT/install/lib/libCling.so] cling::Interpreter::RunFunction(clang::FunctionDecl const*, cling::Value*) (no debug info)
[/Users/cx/software/ROOT/install/lib/libCling.so] cling::Interpreter::EvaluateInternal(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator> const&, cling::CompilationOptions, cling::Value*, cling::Transaction**, unsigned long) (no debug info)
[/Users/cx/software/ROOT/install/lib/libCling.so] cling::MetaSema::actOnxCommand(llvm::StringRef, llvm::StringRef, cling::Value*) (no debug info)
[/Users/cx/software/ROOT/install/lib/libCling.so] cling::MetaParser::isXCommand(cling::MetaSema::ActionResult&, cling::Value*) (no debug info)
[/Users/cx/software/ROOT/install/lib/libCling.so] cling::MetaParser::isCommand(cling::MetaSema::ActionResult&, cling::Value*) (no debug info)
[/Users/cx/software/ROOT/install/lib/libCling.so] cling::MetaProcessor::process(llvm::StringRef, cling::Interpreter::CompilationResult&, cling::Value*, bool) (no debug info)
[/Users/cx/software/ROOT/install/lib/libCling.so] HandleInterpreterException(cling::MetaProcessor*, char const*, cling::Interpreter::CompilationResult&, cling::Value*) (no debug info)
[/Users/cx/software/ROOT/install/lib/libCling.so] TCling::ProcessLine(char const*, TInterpreter::EErrorCode*) (no debug info)
[/Users/cx/software/ROOT/install/lib/libCling.so] TCling::ProcessLineSynch(char const*, TInterpreter::EErrorCode*) (no debug info)
[/Users/cx/software/ROOT/install/lib/libCore.so] TApplication::ExecuteFile(char const*, int*, bool) (no debug info)
[/Users/cx/software/ROOT/install/lib/libRint.so] TRint::ProcessLineNr(char const*, char const*, int*) (no debug info)
[/Users/cx/software/ROOT/install/lib/libRint.so] TRint::Run(bool) (no debug info)
[/Users/cx/software/ROOT/install/bin/root.exe] main (no debug info)
[/usr/lib/dyld] start (no debug info)


Thanks. Could you report it on GitHub ?

Just type .gh bug in the Root terminal and fill it out there.

Thanks for reporting the problem.

We will provide patch soon, but as workaround you can use drawing of dummy rectangle in the beginning:

img->DrawRectangle(0, 0, 0, 0, "#000000", 0);
img->DrawCircle(10, 10, 3, "#FF0000", 1);

PR: [afterimage] prevent nullptr access by ferdymercury · Pull Request #21860 · root-project/root · GitHub