osal: Fix OSAL lock ANB type casting cm-12.1 stable/cm-12.1-YOG4P
authorEthan Chen <intervigil@gmail.com>
Wed, 12 Aug 2015 01:18:47 +0000 (18:18 -0700)
committerEthan Chen <intervigil@gmail.com>
Wed, 12 Aug 2015 01:22:38 +0000 (18:22 -0700)
* commit 9d7f3c9550db35b835be9ca679befbca171c0333 picked the original
  change incorrectly resulting in the useAndroidNativeBuffer function
  passing a pBuffer into a function expecting a buffer_handle_t. This
  would cause CSC to crash when converting video frames.

Change-Id: Ia0270d93558f682d64d830643aba43295414dba1

osal/Exynos_OSAL_Android.cpp

index 8a8a86cd51dd9531f59dc4f4182517323c28ea88..9b7ec6ac80fa07c9ed8a60b69e0c17a9c74af114 100644 (file)
@@ -220,12 +220,11 @@ OMX_ERRORTYPE useAndroidNativeBuffer(
 
     for (i = 0; i < pExynosPort->portDefinition.nBufferCountActual; i++) {
         if (pExynosPort->bufferStateAllocate[i] == BUFFER_STATE_FREE) {
-            OMX_U32 stride;
-
             pExynosPort->extendBufferHeader[i].OMXBufferHeader = temp_bufferHeader;
             pExynosPort->bufferStateAllocate[i] = (BUFFER_STATE_ASSIGNED | HEADER_STATE_ALLOCATED);
             INIT_SET_SIZE_VERSION(temp_bufferHeader, OMX_BUFFERHEADERTYPE);
-            temp_bufferHeader->pBuffer        = pBuffer;
+            android_native_buffer_t *pANB = (android_native_buffer_t *) pBuffer;
+            temp_bufferHeader->pBuffer = (OMX_U8 *)pANB->handle;
             temp_bufferHeader->nAllocLen      = nSizeBytes;
             temp_bufferHeader->pAppPrivate    = pAppPrivate;
             if (nPortIndex == INPUT_PORT_INDEX)