ref: 0a6278b95a6bd1c166be124eb65e4ad80d61354b
parent: d78b76557b356ddd7a6c6b603e9ab74c52ca792f
parent: a439b3c97709604a61fa9ff5d8d02aeae633a69c
author: Johann Koenig <[email protected]>
date: Fri Sep 21 18:30:52 EDT 2018
Merge "better-hw-compatibility: fix out of bounds access"
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -3939,7 +3939,8 @@
#if CONFIG_BETTER_HW_COMPATIBILITY
// forbid 8X4 and 4X8 partitions if any reference frame is scaled.
if (bsize == BLOCK_8X4 || bsize == BLOCK_4X8) {
- int ref_scaled = vp9_is_scaled(&cm->frame_refs[ref_frame - 1].sf);
+ int ref_scaled = ref_frame > INTRA_FRAME &&
+ vp9_is_scaled(&cm->frame_refs[ref_frame - 1].sf);
if (second_ref_frame > INTRA_FRAME)
ref_scaled += vp9_is_scaled(&cm->frame_refs[second_ref_frame - 1].sf);
if (ref_scaled) continue;