shithub: openh264

Download patch

ref: 9b442b3d44bbb2afcdf0bea6e75191d4bacc8982
parent: e48cf9f4718a74196c474aeadee4c8ad48891ef4
parent: 76b0f8c17a38ddafefad58857ac9bcde0d3b3624
author: sijchen <sijchen@cisco.com>
date: Fri Jan 30 05:38:40 EST 2015

Merge pull request #1776 from mstorsjo/mc-test-fix

Avoid writing outside of the target rect in MCHalfPelFilterAnchor

--- a/test/encoder/EncUT_MotionCompensation.cpp
+++ b/test/encoder/EncUT_MotionCompensation.cpp
@@ -49,7 +49,8 @@
       pDstH[x] = Clip255 ((FILTER6TAP (pSrc, x, 1) + 16) >> 5);
     for (int32_t x = -2; x < iWidth + 3; x++) {
       int32_t v = FILTER6TAP (pSrc, x, iStride);
-      pDstV[x] = Clip255 ((v + 16) >> 5);
+      if (x >= 0 && x < iWidth)
+        pDstV[x] = Clip255 ((v + 16) >> 5);
       pBuf[x + 2] = v;
     }
     for (int32_t x = 0; x < iWidth; x++)