projects
/
platform
/
core
/
api
/
mediavision.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
26dcb23
)
mv_common: Add buffer size check
author
Kwanghoon Son
<k.son@samsung.com>
Thu, 14 Jul 2022 05:38:05 +0000
(
01:38
-0400)
committer
Inki Dae
<inki.dae@samsung.com>
Wed, 20 Jul 2022 05:16:57 +0000
(14:16 +0900)
[Issue type] : Bug fix
Change-Id: Iee755ff4d2871a5c1a809b3ec4eed0a73555008c
Reported-by: TSEVEN-2231
Signed-off-by: Kwanghoon Son <k.son@samsung.com>
mv_common/src/CommonUtils.cpp
patch
|
blob
|
history
diff --git
a/mv_common/src/CommonUtils.cpp
b/mv_common/src/CommonUtils.cpp
index 52e6bea50ef765db7940e2297bfbcc7f53dc2a50..4b217145692ab59c2fed2816f6ab8ba25b66bbfa 100644
(file)
--- a/
mv_common/src/CommonUtils.cpp
+++ b/
mv_common/src/CommonUtils.cpp
@@
-99,6
+99,12
@@
int convertSourceMV2GrayCV(mv_source_h mvSource, cv::Mat& cvSource)
return MEDIA_VISION_ERROR_NOT_SUPPORTED_FORMAT;
}
+ if (bufferSize < width * height * channelsNumber) {
+ LOGE("bufferSize : %u is too small for image w: %u, h: %u, c: %u",
+ bufferSize, width, height, channelsNumber);
+ return MEDIA_VISION_ERROR_INVALID_PARAMETER;
+ }
+
if (conversionType == -1) {/* Without conversion */
cvSource = cv::Mat(cv::Size(width, height),
CV_MAKETYPE(depth, channelsNumber), buffer).clone();