From 52a8d37f111298672aafbfb571dbf8439625f468 Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Mon, 16 Mar 2015 18:36:12 +0300 Subject: [PATCH] Fix potential null pointer dereference --- modules/calib3d/src/calibration.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/calib3d/src/calibration.cpp b/modules/calib3d/src/calibration.cpp index 5a86624c50..70f2aafede 100644 --- a/modules/calib3d/src/calibration.cpp +++ b/modules/calib3d/src/calibration.cpp @@ -1595,7 +1595,10 @@ void cvCalibrationMatrixValues( const CvMat *calibMatr, CvSize imgSize, my = imgHeight / apertureHeight; } else { mx = 1.0; - my = *pasp; + if(pasp) + my = *pasp; + else + my = 1.0; } /* Calculate fovx and fovy. */