ref: ebe160568b163bfae72f654ee517a12d838d8595
parent: dbae98082c1129191db46d94ddb45609fc7897c4
author: Yaowu Xu <yaowu@google.com>
date: Wed Jan 22 04:10:44 EST 2014
Prevent invaid memory access Reading second motion vector only when it has a second ref_frame Change-Id: Ica72c1cd955832e15ceccda5e5a17b0bfcd83044
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -500,7 +500,7 @@
if (is_inter_block(mbmi) &&
(mbmi->sb_type < BLOCK_8X8 || mbmi->mode == NEWMV)) {
int_mv best_mv[2];
- for (i = 0; i < 2; ++i)
+ for (i = 0; i < 1 + has_second_ref(mbmi); ++i)
best_mv[i].as_int = mbmi->ref_mvs[mbmi->ref_frame[i]][0].as_int;
vp9_update_mv_count(cpi, x, best_mv);
}
--
⑨