From 8de0373cac7679ef1c0800bb759437a744d64158 Mon Sep 17 00:00:00 2001 From: Sergey Linev Date: Wed, 22 Apr 2026 15:37:41 +0200 Subject: [PATCH] [asimage] fix seg fault when negative coordinate specified Index was checked on max value, but not on negative value --- graf2d/asimage/src/TASImage.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graf2d/asimage/src/TASImage.cxx b/graf2d/asimage/src/TASImage.cxx index 206a3431d565e..2f28b432bb8ae 100644 --- a/graf2d/asimage/src/TASImage.cxx +++ b/graf2d/asimage/src/TASImage.cxx @@ -6723,5 +6723,5 @@ Bool_t TASImage::SetJpegDpi(const char *name, UInt_t set) Int_t TASImage::Idx(Int_t idx) { // The size of arrays like fImage->alt.argb32 is fImage->width*fImage->height - return TMath::Min(idx,(Int_t)(fImage->width*fImage->height)); + return TMath::Max(0, TMath::Min(idx,(Int_t)(fImage->width*fImage->height))); }