shithub: libvpx

Download patch

ref: 6b6f367c3d25bdd87f80a8e5b5380963733c6f0a
parent: 04dce631a2ae079877af1988a930ef236da9eb6c
author: James Berry <jamesberry@google.com>
date: Thu Jul 14 11:53:50 EDT 2011

bug fix vpx_copy_and_extend_frame size issue

vpx_copy_and_extend_frame could incorrectly
resize uv frames which could result in a crash.

Change-Id: Ie96f7078b1e328b3907a06eebeee44ca39a2e898

--- a/vp8/common/extend.c
+++ b/vp8/common/extend.c
@@ -85,10 +85,10 @@
                           src->y_height, src->y_width,
                           et, el, eb, er);
 
-    et = (et + 1) >> 1;
-    el = (el + 1) >> 1;
-    eb = (eb + 1) >> 1;
-    er = (er + 1) >> 1;
+    et = dst->border >> 1;
+    el = dst->border >> 1;
+    eb = (dst->border >> 1) + dst->uv_height - src->uv_height;
+    er = (dst->border >> 1) + dst->uv_width - src->uv_width;
 
     copy_and_extend_plane(src->u_buffer, src->uv_stride,
                           dst->u_buffer, dst->uv_stride,
--