summaryrefslogtreecommitdiff
path: root/mv_barcode/barcode_generator
diff options
context:
space:
mode:
authorTae-Young Chung <ty83.chung@samsung.com>2020-07-02 10:37:52 +0900
committerTae-Young Chung <ty83.chung@samsung.com>2020-07-02 10:41:05 +0900
commitee1853e820b1664ac8be3933aeec558c425c650d (patch)
tree5606472f693005f065471e1e8db86de9baa42e06 /mv_barcode/barcode_generator
parent2acb2a1149d8008c80f3f63f8749c0726e9402e8 (diff)
downloadmediavision-ee1853e820b1664ac8be3933aeec558c425c650d.tar.gz
mediavision-ee1853e820b1664ac8be3933aeec558c425c650d.tar.bz2
mediavision-ee1853e820b1664ac8be3933aeec558c425c650d.zip
MV_BARCODE_UNDEFINED is between valid enumeration range, resulting in generating unexpected barcode image. So, this patch is to prevent the case and return error when MV_BARCODE_UNDEFINED is used. Change-Id: I3df9e5069fdd46fa50d1841a1acad5d863b25fc6 Signed-off-by: Tae-Young Chung <ty83.chung@samsung.com>
Diffstat (limited to 'mv_barcode/barcode_generator')
-rw-r--r--mv_barcode/barcode_generator/src/mv_barcode_generate.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mv_barcode/barcode_generator/src/mv_barcode_generate.c b/mv_barcode/barcode_generator/src/mv_barcode_generate.c
index 83b69e5e..b41e78ec 100644
--- a/mv_barcode/barcode_generator/src/mv_barcode_generate.c
+++ b/mv_barcode/barcode_generator/src/mv_barcode_generate.c
@@ -55,7 +55,7 @@ int mv_barcode_generate_source(
MEDIA_VISION_FUNCTION_ENTER();
if (type < MV_BARCODE_QR ||
- type >= MV_BARCODE_UNKNOWN) {
+ type >= MV_BARCODE_UNKNOWN || type == MV_BARCODE_UNDEFINED) {
LOGE("Not supported barcode type [%d]", type);
return MEDIA_VISION_ERROR_INVALID_PARAMETER;
}
@@ -122,7 +122,7 @@ int mv_barcode_generate_image(
}
if (type < MV_BARCODE_QR ||
- type >= MV_BARCODE_UNKNOWN) {
+ type >= MV_BARCODE_UNKNOWN || type == MV_BARCODE_UNDEFINED) {
LOGE("Not supported barcode type [%d]", type);
return MEDIA_VISION_ERROR_INVALID_PARAMETER;
}