aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBuddy Liong <buddy.liong@ti.com>2016-06-22 12:13:08 -0500
committerBuddy Liong <buddy.liong@ti.com>2016-06-22 12:13:08 -0500
commitf83e785d2b98404fed9e3a6264bf4945c65abd12 (patch)
tree8552d5db0e5608f518ff0d231d794a8615bc471f
parentd0d2e63691f4c6906aa9ae28c16f5b92de8c1bcd (diff)
downloaddce-f83e785d2b98404fed9e3a6264bf4945c65abd12.tar.gz
Valid id checking for callbackmsg[id]).row_mode in process()3.00.11.00
In VIDDEC3_process or VIDENC2_process, if low latency is used, then id will have a valid value of >= 0. When full frame is used, after process call, there is a condition check of callbackmsg[id]).row_mode. Problem is that id might not be valid for full frame. With id value < 0, the value in callbackmsg[id]).row_mode can be guarantee to be correct. Issue is found when id = -1 and the value of callbackmsg[-1]).row_mode points to less than 0, which causes the condition to pass. This commit is fixing the issue by adding additional check to make sure id is >= 0 when calling callbackmsg[id]).row_mode so that the condition check will be valid to determine low latency mode or full frame mode after process(). Change-Id: I93209e4da42305e807824565bf676c8bdd33d72a Signed-off-by: Buddy Liong <buddy.liong@ti.com>
-rw-r--r--libdce.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libdce.c b/libdce.c
index 9c7a605..583b4d7 100644
--- a/libdce.c
+++ b/libdce.c
@@ -1175,7 +1175,7 @@ XDAS_Int32 VIDDEC3_process(VIDDEC3_Handle codec,
ret = process(codec, inBufs, outBufs, inArgs, outArgs, OMAP_DCE_VIDDEC3);
DEBUG("<< ret=%d", ret);
- if( (callbackmsg[id]).row_mode ) {
+ if( (id >= 0) && ((callbackmsg[id]).row_mode) ) {
DEBUG("(callbackmsg[%d]).receive_numBlocks %d >= (callbackmsg[%d]).total_numBlocks %d",
id, (callbackmsg[id]).receive_numBlocks, id, (callbackmsg[id]).total_numBlocks);
@@ -1386,7 +1386,7 @@ XDAS_Int32 VIDENC2_process(VIDENC2_Handle codec,
ret = process(codec, inBufs, outBufs, inArgs, outArgs, OMAP_DCE_VIDENC2);
DEBUG("<< ret=%d", ret);
- if( (callbackmsg[id]).row_mode ) {
+ if( (id >= 0) && ((callbackmsg[id]).row_mode) ) {
/* Stop the callback to request to client */
DEBUG("Stop the callback to client callbackmsg[%d]->getDataFlag %d", id, (callbackmsg[id]).getDataFlag);
(callbackmsg[id]).getDataFlag = 0;