7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 14:51:41 +00:00

Gate against 0 width and height to the render job

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19443
This commit is contained in:
Marek Roszko 2025-01-01 14:41:45 -05:00
parent c5ae32c51c
commit 65a2d95282

View File

@ -451,6 +451,14 @@ int PCBNEW_JOBS_HANDLER::JobExportRender( JOB* aJob )
if( aRenderJob == nullptr )
return CLI::EXIT_CODES::ERR_UNKNOWN;
// Reject width and height being invalid
// Final bit of sanity because this can blow things up
if( aRenderJob->m_width <= 0 || aRenderJob->m_height <= 0 )
{
m_reporter->Report( _( "Invalid image dimensions" ), RPT_SEVERITY_ERROR );
return CLI::EXIT_CODES::ERR_ARGS;
}
BOARD* brd = getBoard( aRenderJob->m_filename );
if( !brd )