]> code.ossystems Code Review - meta-freescale.git/commitdiff
libfslvpuwrap_1.0.46: fix IOGetVirtMem calls
authorEric Nelson <eric.nelson@boundarydevices.com>
Sat, 28 Jun 2014 17:58:59 +0000 (10:58 -0700)
committerOtavio Salvador <otavio@ossystems.com.br>
Sat, 28 Jun 2014 18:37:35 +0000 (15:37 -0300)
IOGetVirtMem() returns a pointer or specifically -1 (MAP_FAILED)
in the case of failure, and a couple of calls were improperly testing
for zero.

Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
meta-fsl-arm/recipes-multimedia/libfslvpuwrap/libfslvpuwrap/0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch [new file with mode: 0644]
meta-fsl-arm/recipes-multimedia/libfslvpuwrap/libfslvpuwrap_1.0.46.bb

diff --git a/meta-fsl-arm/recipes-multimedia/libfslvpuwrap/libfslvpuwrap/0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch b/meta-fsl-arm/recipes-multimedia/libfslvpuwrap/libfslvpuwrap/0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch
new file mode 100644 (file)
index 0000000..ccd2d9e
--- /dev/null
@@ -0,0 +1,41 @@
+From 7ca66c10c05168c7d342df7c7a70d4a1ae0629f7 Mon Sep 17 00:00:00 2001
+From: Eric Nelson <eric.nelson@boundarydevices.com>
+Date: Sat, 28 Jun 2014 09:45:09 -0700
+Subject: [PATCH] vpu_wrapper: fix tests of return value from IOGetVirtMem
+
+IOGetVirtMem() returns a pointer or specifically -1 (MAP_FAILED)
+in the case of failure.
+
+Upstream-Status: Pending
+
+Signed-off-by: Laci Tele <laci@boundarydevices.com>
+Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
+---
+ vpu_wrapper.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/vpu_wrapper.c b/vpu_wrapper.c
+index 9249174..148c5df 100755
+--- a/vpu_wrapper.c
++++ b/vpu_wrapper.c
+@@ -6653,7 +6653,7 @@ VpuDecRetCode VPU_DecGetMem(VpuMemDesc* pInOutMem)
+               return VPU_DEC_RET_FAILURE;
+       }
+       ret=IOGetVirtMem(&buff);
+-      if(ret==0) //if(ret!=RETCODE_SUCCESS)
++      if(ret == -1) //if(ret==MAP_FAILED)
+       {
+               VPU_ERROR("%s: get virtual memory failure: size=%d, ret=%d \r\n",__FUNCTION__,buff.size,ret);
+               return VPU_DEC_RET_FAILURE;
+@@ -8277,7 +8277,7 @@ VpuEncRetCode VPU_EncGetMem(VpuMemDesc* pInOutMem)
+               return VPU_ENC_RET_FAILURE;
+       }
+       ret=IOGetVirtMem(&buff);
+-      if(ret==0) //if(ret!=RETCODE_SUCCESS)
++      if(ret == -1) //if(ret==MAP_FAILED)
+       {
+               VPU_ENC_ERROR("%s: get virtual memory failure: size=%d, ret=%d \r\n",__FUNCTION__,buff.size,(UINT32)ret);
+               return VPU_ENC_RET_FAILURE;
+-- 
+1.9.1
+
index e4970e2510580be561ab5537a56b7abcd5619201..8cc15234a2776e880f2b8e700330ce3a1e2fe669 100644 (file)
@@ -10,6 +10,8 @@ SRC_URI = "${FSL_MIRROR}/${PN}-${PV}.bin;fsl-eula=true"
 SRC_URI[md5sum] = "1f50110cb6de8ebf767fb9c5f8baf20d"
 SRC_URI[sha256sum] = "7fc1258de338339d19a1a35167393fdc4d773682dfd9b951b197403a075f85fd"
 
+SRC_URI_append = " file://0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch"
+
 inherit fsl-eula-unpack autotools pkgconfig
 
 do_install_append() {