Fix SVACE defect (SIGN_EXTENSION) 30/296830/1 accepted/tizen_8.0_unified tizen_8.0 accepted/tizen/8.0/unified/20231005.094402 accepted/tizen/unified/20230808.170217 tizen_8.0_m2_release
authorSeungbae Shin <seungbae.shin@samsung.com>
Fri, 4 Aug 2023 11:55:33 +0000 (20:55 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Fri, 4 Aug 2023 11:58:39 +0000 (20:58 +0900)
Unsafe conversion of expression with type 'unsigned int' to implementation defined type 'std::streamsize'
may or may not override sign-bit depending on size of implementation defined type,
which may cause unexpected results on porting to different platforms

[Version] 0.0.17
[Issue Type] SVACE

Change-Id: Ie537de2c380418c2713983837f749b4540bd6384

packaging/hal-api-audio.spec
testcase/audio_haltests.cpp

index 1d7c8ec..78465f9 100644 (file)
@@ -1,6 +1,6 @@
 Name:       hal-api-audio
 Summary:    TIZEN Audio HAL
-Version:    0.0.16
+Version:    0.0.17
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
index 6865410..80b10c2 100644 (file)
@@ -195,7 +195,7 @@ int32_t AudioHalTest::WritePcmFromFile(pcm_handle pcm_h)
                }
 
 #ifdef USE_IFSTREAM
-               fs.read(buffer.data(), min(FramesToBytes(avail_frames), static_cast<uint32_t>(buffer.size())));
+               fs.read(buffer.data(), static_cast<std::streamsize>(min(FramesToBytes(avail_frames), static_cast<uint32_t>(buffer.size()))));
                bytes_read = fs.gcount();
 #else
                bytes_read = read(fd, buffer.data(), min(FramesToBytes(avail_frames), static_cast<uint32_t>(buffer.size())));