mirror of
https://github.com/zebrajr/opencv.git
synced 2025-12-06 00:19:46 +01:00
Merge pull request #27486 from asmorkalov:as/qrcode_encode_java_ub_fix
Fixed out-of-bound access issue in QR Encoder Java warappers
This commit is contained in:
commit
3ff2ce3291
|
|
@ -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 (...) {",
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user