- OpenCV => 4.5.4 (not specifically)
QRCodeDetector::decode (also QRCodeDetector::detectAndDecode) crashes trying to allocate an unreasonable amount of memory.
cv2.error: OpenCV(4.5.4) D:\a\opencv-python\opencv-python\opencv\modules\core\src\alloc.cpp:73: error: (-4:Insufficient memory) Failed to allocate 54056250000 bytes in function 'cv::OutOfMemoryError'
Steps to reproduce
Use the attached QR code
import cv2 as cv
im = cv.imread("hIfAR.png")
det = cv.QRCodeDetector()
(rv, points) = det.detect(im) # succeeds
(data, rectified) = det.decode(im, points) # fails
# (data, points, rectified) = det.detectAndDecode(im) # also fails
The issue was brought to my attention by pepoluan on Stack Overflow, who allows the code to be a test case. The code contains a zip file of a json file.
the information within the Zip file is dummy info, so it's okay to be public.
