mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Add safeguards to SVG loading implementation
This commit is contained in:
parent
5e7573b654
commit
cce4e89c22
1 changed files with 4 additions and 0 deletions
|
|
@ -391,6 +391,10 @@ namespace Flow.Launcher.Infrastructure.Image
|
|||
|
||||
// Calculate scale to achieve desired height
|
||||
var drawingBounds = drawing.Bounds;
|
||||
if (drawingBounds.Height <= 0)
|
||||
{
|
||||
throw new InvalidOperationException($"Invalid SVG dimensions: Height must be greater than zero in {path}");
|
||||
}
|
||||
var scale = desiredHeight / drawingBounds.Height;
|
||||
var scaledWidth = drawingBounds.Width * scale;
|
||||
var scaledHeight = drawingBounds.Height * scale;
|
||||
|
|
|
|||
Loading…
Reference in a new issue