ref: 0e97bacdf3521ae0ff7292066dcfe43f3147f5c9
parent: 1535c0f951c81b8691cdc313a0c7345ae848b967
author: xiaotiansf <xiaotianshimail@gmail.com>
date: Mon Aug 13 08:39:13 EDT 2018
fix BugZilla Bug-1479658 index -1 out of bounds for type 'int16_t [17]'
--- a/codec/decoder/core/src/mv_pred.cpp
+++ b/codec/decoder/core/src/mv_pred.cpp
@@ -678,7 +678,8 @@
UpdateP16x16MotionOnly (pCurLayer, LIST_1, iMvp[LIST_1]);
UpdateP16x16RefIdx (pCurLayer, LIST_0, ref[LIST_0]);
} else {
- ref[LIST_0] = pCurLayer->iColocRefIndex[LIST_0][0];
+ ref[LIST_0] = pCurLayer->iColocRefIndex[LIST_0][0] >= 0 ? pCurLayer->iColocRefIndex[LIST_0][0] :
+ pCurLayer->iColocRefIndex[LIST_1][0];
const int16_t (*mvColoc)[2] = 0 == ref[LIST_0] ? pCurLayer->iColocMv[LIST_0] : pCurLayer->iColocMv[LIST_1];
const int16_t* mv = mvColoc[0];
UpdateP16x16RefIdx (pCurLayer, LIST_0, ref[LIST_0]);