Fix svace issue
authorMinje Ahn <minje.ahn@samsung.com>
Wed, 9 Nov 2016 01:53:05 +0000 (10:53 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Wed, 9 Nov 2016 01:53:05 +0000 (10:53 +0900)
Change-Id: Iaf1de3516489c512ef81a9b3aed0666293c7ed91
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
packaging/csapi-multimedia.spec
src/Tizen.Multimedia/MetadataExtractor/MetadataExtractor.cs
src/Tizen.Multimedia/MetadataExtractor/MetadataExtractorErrorFactory.cs

index 4a6d0ec..7e6b27f 100644 (file)
@@ -8,7 +8,7 @@
 
 Name:       csapi-multimedia
 Summary:    Tizen Multimedia API for C#
-Version:    1.0.11
+Version:    1.0.12
 Release:    0
 Group:      Development/Libraries
 License:    Apache-2.0
index 7087bc5..70e3e01 100755 (executable)
@@ -68,17 +68,18 @@ namespace Tizen.Multimedia
                public MetadataExtractor(byte[] buffer)
                {
                        int ret;
-                       int size = buffer.Length;
-                       IntPtr buf = Marshal.AllocHGlobal(size);
 
-                       if (buffer == null || size == 0)
+                       if (buffer == null || buffer.Length == 0)
                        {
                                Log.Error(MetadataExtractorLog.LogTag, "buffer is null");
                                MetadataExtractorErrorFactory.ThrowException((int)MetadataExtractorError.InvalidParameter, "buffer is null");
                        }
                        else
-                       {
-                               Marshal.Copy(buffer, 0, buf, size);
+            {
+                int size = buffer.Length;
+                IntPtr buf = Marshal.AllocHGlobal(size);
+                Marshal.Copy(buffer, 0, buf, size);
+
                                ret = Interop.MetadataExtractor.Create(out _handle);
                                if (ret != (int)MetadataExtractorError.None)
                                {
index 93a2301..9b34ab5 100755 (executable)
@@ -38,21 +38,16 @@ namespace Tizen.Multimedia
        {
                internal static void ThrowException(int errorCode, string errorMessage = null, string paramName = null)
                {
-                       MetadataExtractorError err = (MetadataExtractorError)errorCode;
-                       if(string.IsNullOrEmpty(errorMessage))
-                       {
-                               errorMessage = err.ToString();
-                       }
                        switch ((MetadataExtractorError)errorCode)
                        {
                                case MetadataExtractorError.InvalidParameter:
-                                       throw new ArgumentException(errorMessage, paramName);
+                                       throw new ArgumentException("[" + errorCode.ToString() + "]" + errorMessage, paramName);
 
                                case MetadataExtractorError.OutOfMemory:
                                case MetadataExtractorError.FileExists:
                                case MetadataExtractorError.PermissionDenied:
                                case MetadataExtractorError.MetadataExtractorErrorOperationFailed:
-                                       throw new InvalidOperationException(errorMessage);
+                                       throw new InvalidOperationException("[" + errorCode.ToString() + "]" + errorMessage);
                        }
                }
        }