remove misleading error messages: free only allocated ion buffers on exit

Fixed of print error message that occurs at the end of the video play.
ex)
 E/ion(130): ioctl c0044901 failed with code -1: Invalid argument

Bug: 17720260
Change-Id: Ib823b8d5e9bf80a07917d17379d5e6d6022e8a66
Signed-off-by: SeungBeom Kim <sbcrux.kim@samsung.com>
diff --git a/exynos_omx/openmax/exynos_omx/osal/Exynos_OSAL_Android.cpp b/exynos_omx/openmax/exynos_omx/osal/Exynos_OSAL_Android.cpp
index fb64735..997b926 100644
--- a/exynos_omx/openmax/exynos_omx/osal/Exynos_OSAL_Android.cpp
+++ b/exynos_omx/openmax/exynos_omx/osal/Exynos_OSAL_Android.cpp
@@ -420,9 +420,12 @@
 
     for (i = 0; i < MAX_BUFFER_REF; i++) {
         if (phREF->SharedBuffer[i].BufferFd == BufferFd) {
-            ion_decRef(getIonFd(module), phREF->SharedBuffer[i].pIonHandle);
-            ion_decRef(getIonFd(module), phREF->SharedBuffer[i].pIonHandle1);
-            ion_decRef(getIonFd(module), phREF->SharedBuffer[i].pIonHandle2);
+            if (phREF->SharedBuffer[i].BufferFd > -1)
+                ion_decRef(getIonFd(module), phREF->SharedBuffer[i].pIonHandle);
+            if (phREF->SharedBuffer[i].BufferFd1 > -1)
+                ion_decRef(getIonFd(module), phREF->SharedBuffer[i].pIonHandle1);
+            if (phREF->SharedBuffer[i].BufferFd2 > -1)
+                ion_decRef(getIonFd(module), phREF->SharedBuffer[i].pIonHandle2);
             phREF->SharedBuffer[i].cnt--;
             if (phREF->SharedBuffer[i].cnt == 0) {
                 phREF->SharedBuffer[i].BufferFd    = -1;