Fix SVACE defects 86/100986/1
authorSeungbae Shin <seungbae.shin@samsung.com>
Tue, 29 Nov 2016 12:23:28 +0000 (21:23 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Wed, 30 Nov 2016 04:55:33 +0000 (20:55 -0800)
[Version] 0.3.46
[Profile] Common
[Issue Type] SVACE

Change-Id: I53dcb7508e12831a1bfca607237dd143b134f7c9
(cherry picked from commit b661abcb5a4628ee05d1f6012f8496d28640778c)

packaging/capi-media-audio-io.spec
src/cpp/cpp_audio_io.cpp

index 7c36bf2..82d0e53 100644 (file)
@@ -1,6 +1,6 @@
 Name:           capi-media-audio-io
 Summary:        An Audio Input & Audio Output library in Tizen Native API
-Version:        0.3.45
+Version:        0.3.46
 Release:        0
 Group:          Multimedia/API
 License:        Apache-2.0
index 10ffe8a..54fcfbe 100644 (file)
@@ -390,7 +390,7 @@ int cpp_audio_in_create(int sample_rate, audio_channel_e channel, audio_sample_t
         CAudioInfo audioInfo = __generate_audio_input_info(sample_rate, channel, type);
 
         handle->audioIoHandle = new CAudioInput(audioInfo);
-        if (handle == NULL) {
+        if (handle->audioIoHandle == NULL) {
             THROW_ERROR_MSG(CAudioError::EError::ERROR_OUT_OF_MEMORY, "Failed allocation internal handle");
         }
 
@@ -433,7 +433,7 @@ int cpp_audio_in_create_loopback(int sample_rate, audio_channel_e channel, audio
         CAudioInfo audioInfo = __generate_audio_input_loopback_info(sample_rate, channel, type);
 
         handle->audioIoHandle = new CAudioInput(audioInfo);
-        if (handle == NULL) {
+        if (handle->audioIoHandle == NULL) {
             THROW_ERROR_MSG(CAudioError::EError::ERROR_OUT_OF_MEMORY, "Failed allocation internal handle");
         }
 
@@ -1066,7 +1066,7 @@ int cpp_audio_out_create_new(int sample_rate, audio_channel_e channel, audio_sam
         CAudioInfo audioInfo = __generate_audio_output_info(sample_rate, channel, type, SOUND_TYPE_MEDIA /* default sound_type */);
 
         handle->audioIoHandle = new CAudioOutput(audioInfo);
-        if (handle == NULL) {
+        if (handle->audioIoHandle == NULL) {
             THROW_ERROR_MSG(CAudioError::EError::ERROR_OUT_OF_MEMORY, "Failed allocation internal handle");
         }