Bug 1224363 - Upstream update patch - r=rillian

This commit is contained in:
Gerald Squelart 2015-12-03 14:14:45 +11:00
parent f773f16b12
commit ab15f250cf
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,38 @@
# HG changeset patch
# User Gerald Squelart <gsquelart@mozilla.com>
# Parent b9e641a34c2fb9e6f3d3a02200bc2d800b6ca168
Bug 1224363 - Clamp seg_lvl also in abs-value mode - r=rillian
Even when the segment feature data is in absolute mode, it is still read as a
6-bit value with an added sign, so it could have values between -63 and +63.
Later, this signed value is used without checks as a filter level, which is
used to access an entry in an array of size MAX_LOOP_FILTER+1=64.
This patch just extends the existing clamping (that was done only to relative-
mode data) to absolute mode data, before it is blindly 'memset' in
lfi->lvl[seg][0], which was where the out-of-bound filter_value was read in
subsequent vp8_loop_filter_row_simple.
diff --git a/media/libvpx/vp8/common/loopfilter.c b/media/libvpx/vp8/common/loopfilter.c
--- a/media/libvpx/vp8/common/loopfilter.c
+++ b/media/libvpx/vp8/common/loopfilter.c
@@ -136,18 +136,18 @@ void vp8_loop_filter_frame_init(VP8_COMM
/* Abs value */
if (mbd->mb_segement_abs_delta == SEGMENT_ABSDATA)
{
lvl_seg = mbd->segment_feature_data[MB_LVL_ALT_LF][seg];
}
else /* Delta Value */
{
lvl_seg += mbd->segment_feature_data[MB_LVL_ALT_LF][seg];
- lvl_seg = (lvl_seg > 0) ? ((lvl_seg > 63) ? 63: lvl_seg) : 0;
}
+ lvl_seg = (lvl_seg > 0) ? ((lvl_seg > 63) ? 63: lvl_seg) : 0;
}
if (!mbd->mode_ref_lf_delta_enabled)
{
/* we could get rid of this if we assume that deltas are set to
* zero when not in use; encoder always uses deltas
*/
memset(lfi->lvl[seg][0], lvl_seg, 4 * 4 );

View File

@ -594,6 +594,8 @@ def apply_patches():
os.system("patch -p1 < vp9_filter_restore_aligment.patch")
# Patch win32 vpx_once.
os.system("patch -p3 < vpx_once.patch")
# Bug 1224363 - Clamp seg_lvl also in abs-value mode.
os.system("patch -p3 < clamp_abs_lvl_seg.patch")
def update_readme(commit):
with open('README_MOZILLA') as f: