diff options
author | Tae-Young Chung <ty83.chung@samsung.com> | 2020-07-02 10:37:52 +0900 |
---|---|---|
committer | Tae-Young Chung <ty83.chung@samsung.com> | 2020-07-02 10:41:05 +0900 |
commit | ee1853e820b1664ac8be3933aeec558c425c650d (patch) | |
tree | 5606472f693005f065471e1e8db86de9baa42e06 | |
parent | 2acb2a1149d8008c80f3f63f8749c0726e9402e8 (diff) | |
download | mediavision-ee1853e820b1664ac8be3933aeec558c425c650d.tar.gz mediavision-ee1853e820b1664ac8be3933aeec558c425c650d.tar.bz2 mediavision-ee1853e820b1664ac8be3933aeec558c425c650d.zip |
Fix to return invalid parameter when MV_BARCODE_UNDEFINED is givensubmit/tizen/20200708.035054submit/tizen/20200706.003724submit/tizen/20200702.015201accepted/tizen/unified/20200708.125320
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>
-rw-r--r-- | mv_barcode/barcode_generator/src/mv_barcode_generate.c | 4 |
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; } |