1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-21 19:33:03 +04:00

Fixed out-of-bound access issue in QR Encoder Java warappers.

This commit is contained in:
Alexander Smorkalov
2025-06-26 17:19:10 +03:00
parent d2d90dd1cd
commit d9e2b4c650
+2 -1
View File
@@ -34,8 +34,9 @@
" LOGD(\"%s\", method_name);",
" Ptr<cv::QRCodeEncoder>* me = (Ptr<cv::QRCodeEncoder>*) self; //TODO: check for NULL",
" const char* n_encoded_info = reinterpret_cast<char*>(env->GetByteArrayElements(encoded_info, NULL));",
" const jsize n_encoded_info_size = env->GetArrayLength(encoded_info);",
" Mat& qrcode = *((Mat*)qrcode_nativeObj);",
" (*me)->encode( n_encoded_info, qrcode );",
" (*me)->encode( std::string(n_encoded_info, n_encoded_info_size), qrcode );",
" } catch(const std::exception &e) {",
" throwJavaException(env, &e, method_name);",
" } catch (...) {",