ref: 0f37601fd75c1a769ff2a0dbdea7169649f1dc13
parent: 915d5c12d3b996d33cff188d5f283563ec2df86a
parent: 8cbeb7cf3604c42bdd1b11b2235667695a1f7e20
author: Yaowu Xu <[email protected]>
date: Fri Mar 6 02:27:58 EST 2015
Merge changes I1b972c94,I9c897d32 * changes: Prevent invalid memory access Use correct bsize for uv
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -595,9 +595,16 @@
for (i = 1; i <= 2; ++i) {
struct macroblock_plane *p = &x->plane[i];
struct macroblockd_plane *pd = &xd->plane[i];
+#if GLOBAL_MOTION
+ const BLOCK_SIZE bs = get_plane_block_size(bsize, pd);
+#else
const BLOCK_SIZE bs = get_plane_block_size(BLOCK_64X64, pd);
- uv_sad = cpi->fn_ptr[bs].sdf(p->src.buf, p->src.stride,
- pd->dst.buf, pd->dst.stride);
+#endif
+ if (bs == BLOCK_INVALID)
+ uv_sad = INT_MAX;
+ else
+ uv_sad = cpi->fn_ptr[bs].sdf(p->src.buf, p->src.stride,
+ pd->dst.buf, pd->dst.stride);
#if GLOBAL_MOTION
x->color_sensitivity[i - 1] = uv_sad * 4 > y_sad;