Commit 88563aba authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Prevent divide by zero crash in Android preview auto resize

parent 57ff5c11
......@@ -501,6 +501,9 @@ public class AndroidPlatformHelper {
if (maxWidth == 0 || maxHeight == 0) {
Log.w("[Platform Helper] Abort resizing preview so that it won't be visible");
return;
} else if (width == 0 || height == 0) {
Log.e("[Platform Helper] Abort resizing preview to prevent divide by zero crash, video size is " + width + "x" + height);
return;
}
// A MATCH_PARENT will take over a WRAP_CONTENT or a fixed size and maintain ratio
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment