Merge pull request #30286 from vrabaud:fuzztest_fixes

Fix code according to fuzzer findings - #30286

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
Vincent Rabaud
2026-10-19 08:39:08 +02:00
committed by GitHub
parent 719f8535e7
commit ec8d521e11
52 changed files with 629 additions and 49 deletions

View File

@@ -438,14 +438,16 @@ public class GeometryTest extends OpenCVTestCase {
}
public void testGetDefaultNewCameraMatrixMat() {
Mat mtx = Geometry.getDefaultNewCameraMatrix(gray0);
Mat cameraMatrix = new Mat(3, 3, CvType.CV_8U, new Scalar(0));
Mat mtx = Geometry.getDefaultNewCameraMatrix(cameraMatrix);
assertFalse(mtx.empty());
assertEquals(0, Core.countNonZero(mtx));
}
public void testGetDefaultNewCameraMatrixMatSizeBoolean() {
Mat mtx = Geometry.getDefaultNewCameraMatrix(gray0, size, true);
Mat cameraMatrix = new Mat(3, 3, CvType.CV_8U, new Scalar(0));
Mat mtx = Geometry.getDefaultNewCameraMatrix(cameraMatrix, size, true);
assertFalse(mtx.empty());
assertFalse(0 == Core.countNonZero(mtx));