povray
povray copied to clipboard
Renderer hangs if the partial rendering area is not normalized
If the coordinates the partial render are not normalized, no error is given but the renderer hangs indefinitely. Any scene will do:
#version 3.7;
sphere { 0, 1 }
If the program is invoked with (for instance) povray test.pov +SC0.6 +EC0.4
where the start and end columns are reversed, the program hangs during rendering. It does the same if the row coordinates are reversed. It also behaves the same if integer coordinates are given.
I have tested this with the master
and release/v3.8.0
branches and it behaves identically in each. It should signal an error instead.
The problem can be fixed with the following patch:
diff --git a/source/backend/scene/view.cpp b/source/backend/scene/view.cpp
index f924e9c..4b8d48e 100644
--- a/source/backend/scene/view.cpp
+++ b/source/backend/scene/view.cpp
@@ -775,6 +775,8 @@ void View::StartRender(POVMS_Object& renderOptions)
throw POV_EXCEPTION(kParamErr, "Invalid start column or row");
if ((viewData.renderArea.right >= viewData.GetWidth()) || (viewData.renderArea.bottom >= viewData.GetHeight()))
throw POV_EXCEPTION(kParamErr, "Invalid end column or row");
+ if ((viewData.renderArea.left > viewData.renderArea.right) || (viewData.renderArea.top > viewData.renderArea.bottom))
+ throw POV_EXCEPTION(kParamErr, "Partial render coordinates are not normalized");
viewData.blockSize = renderOptions.TryGetInt(kPOVAttrib_RenderBlockSize, 32);
if(viewData.blockSize < 4)
Thanks for the issue post and suggested patch. I saw it last fall, but yet to put together a pull request for it.
Related. Yesterday while debugging I hit an issue where I was unable to specify the first column or first row as in +sc1 or +sr1 - in other words had to start with +sc2 or +sr2 - we should look to fix this issue along with yours.
The column, row 1 issue was familiar to me as it was one I fixed 15 years or so back in Megapov. Guess the fix never made it into POV-Ray proper!