diff options
author | Buddy Liong | 2016-06-22 12:13:08 -0500 |
---|---|---|
committer | Buddy Liong | 2016-06-22 12:13:08 -0500 |
commit | f83e785d2b98404fed9e3a6264bf4945c65abd12 (patch) | |
tree | 8552d5db0e5608f518ff0d231d794a8615bc471f | |
parent | d0d2e63691f4c6906aa9ae28c16f5b92de8c1bcd (diff) | |
download | repo-libdce-f83e785d2b98404fed9e3a6264bf4945c65abd12.tar.gz repo-libdce-f83e785d2b98404fed9e3a6264bf4945c65abd12.tar.xz repo-libdce-f83e785d2b98404fed9e3a6264bf4945c65abd12.zip |
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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1175,7 +1175,7 @@ XDAS_Int32 VIDDEC3_process(VIDDEC3_Handle codec, | |||
1175 | ret = process(codec, inBufs, outBufs, inArgs, outArgs, OMAP_DCE_VIDDEC3); | 1175 | ret = process(codec, inBufs, outBufs, inArgs, outArgs, OMAP_DCE_VIDDEC3); |
1176 | DEBUG("<< ret=%d", ret); | 1176 | DEBUG("<< ret=%d", ret); |
1177 | 1177 | ||
1178 | if( (callbackmsg[id]).row_mode ) { | 1178 | if( (id >= 0) && ((callbackmsg[id]).row_mode) ) { |
1179 | DEBUG("(callbackmsg[%d]).receive_numBlocks %d >= (callbackmsg[%d]).total_numBlocks %d", | 1179 | DEBUG("(callbackmsg[%d]).receive_numBlocks %d >= (callbackmsg[%d]).total_numBlocks %d", |
1180 | id, (callbackmsg[id]).receive_numBlocks, id, (callbackmsg[id]).total_numBlocks); | 1180 | id, (callbackmsg[id]).receive_numBlocks, id, (callbackmsg[id]).total_numBlocks); |
1181 | 1181 | ||
@@ -1386,7 +1386,7 @@ XDAS_Int32 VIDENC2_process(VIDENC2_Handle codec, | |||
1386 | ret = process(codec, inBufs, outBufs, inArgs, outArgs, OMAP_DCE_VIDENC2); | 1386 | ret = process(codec, inBufs, outBufs, inArgs, outArgs, OMAP_DCE_VIDENC2); |
1387 | DEBUG("<< ret=%d", ret); | 1387 | DEBUG("<< ret=%d", ret); |
1388 | 1388 | ||
1389 | if( (callbackmsg[id]).row_mode ) { | 1389 | if( (id >= 0) && ((callbackmsg[id]).row_mode) ) { |
1390 | /* Stop the callback to request to client */ | 1390 | /* Stop the callback to request to client */ |
1391 | DEBUG("Stop the callback to client callbackmsg[%d]->getDataFlag %d", id, (callbackmsg[id]).getDataFlag); | 1391 | DEBUG("Stop the callback to client callbackmsg[%d]->getDataFlag %d", id, (callbackmsg[id]).getDataFlag); |
1392 | (callbackmsg[id]).getDataFlag = 0; | 1392 | (callbackmsg[id]).getDataFlag = 0; |