From: Tae-Young Chung Date: Wed, 1 Jun 2016 04:02:21 +0000 (+0900) Subject: [Fixed Bug] Fixed NULL pointer access X-Git-Tag: accepted/tizen/common/20160603.150908^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F28%2F72428%2F1;p=platform%2Fcore%2Fapi%2Fmediavision.git [Fixed Bug] Fixed NULL pointer access [cause] - Access null pointer of fgcolour and bgcolour when engine_cfg is null [solve] - Access them when engine_cfg is available Change-Id: Ieb58f331b2e7bba1d8281d2baa63cbf60959b9d9 Signed-off-by: Tae-Young Chung --- diff --git a/mv_barcode/barcode_generator/src/mv_barcode_generate_open.cpp b/mv_barcode/barcode_generator/src/mv_barcode_generate_open.cpp index 558300b..498cbf9 100644 --- a/mv_barcode/barcode_generator/src/mv_barcode_generate_open.cpp +++ b/mv_barcode/barcode_generator/src/mv_barcode_generate_open.cpp @@ -264,27 +264,27 @@ int mv_barcode_generate_source_open( LOGW("mv_engine_config_get_string_attribute failed"); return error; } - } - - /* - The input colorspace is RGB but the generators' is BGR. - Replace the value of R with that of B - */ - value = fgcolour[0]; - fgcolour[0] = fgcolour[4]; - fgcolour[4] = value; - - value = fgcolour[1]; - fgcolour[1] = fgcolour[5]; - fgcolour[5] = value; - value = bgcolour[0]; - bgcolour[0] = bgcolour[4]; - bgcolour[4] = value; - - value = bgcolour[1]; - bgcolour[1] = bgcolour[5]; - bgcolour[5] = value; + /* + The input colorspace is RGB but the generators' is BGR. + Replace the value of R with that of B + */ + value = fgcolour[0]; + fgcolour[0] = fgcolour[4]; + fgcolour[4] = value; + + value = fgcolour[1]; + fgcolour[1] = fgcolour[5]; + fgcolour[5] = value; + + value = bgcolour[0]; + bgcolour[0] = bgcolour[4]; + bgcolour[4] = value; + + value = bgcolour[1]; + bgcolour[1] = bgcolour[5]; + bgcolour[5] = value; + } error = BarcodeGenerator::generateBarcodeToBuffer( &imageBuffer, @@ -426,27 +426,28 @@ int mv_barcode_generate_image_open( LOGW("mv_engine_config_get_string_attribute failed"); return error; } - } - /* - The input colorspace is RGB but the generators' is BGR. - Replace the value of R with that of B - */ - value = fgcolour[0]; - fgcolour[0] = fgcolour[4]; - fgcolour[4] = value; - - value = fgcolour[1]; - fgcolour[1] = fgcolour[5]; - fgcolour[5] = value; - - value = bgcolour[0]; - bgcolour[0] = bgcolour[4]; - bgcolour[4] = value; - - value = bgcolour[1]; - bgcolour[1] = bgcolour[5]; - bgcolour[5] = value; + /* + The input colorspace is RGB but the generators' is BGR. + Replace the value of R with that of B + */ + value = fgcolour[0]; + fgcolour[0] = fgcolour[4]; + fgcolour[4] = value; + + value = fgcolour[1]; + fgcolour[1] = fgcolour[5]; + fgcolour[5] = value; + + value = bgcolour[0]; + bgcolour[0] = bgcolour[4]; + bgcolour[4] = value; + + value = bgcolour[1]; + bgcolour[1] = bgcolour[5]; + bgcolour[5] = value; + + } error = BarcodeGenerator::generateBarcodeToImage( std::string(image_path), diff --git a/packaging/capi-media-vision.spec b/packaging/capi-media-vision.spec index 7d2562c..3f33e5e 100644 --- a/packaging/capi-media-vision.spec +++ b/packaging/capi-media-vision.spec @@ -1,6 +1,6 @@ Name: capi-media-vision Summary: Media Vision library for Tizen Native API -Version: 0.3.15 +Version: 0.3.16 Release: 1 Group: Multimedia/Framework License: Apache-2.0 and BSD-2.0