[x265] [PATCH] Fix: Crash of 8 bit video clip in HIGH_BIT_DEPTH mode

sagar at multicorewareinc.com sagar at multicorewareinc.com
Mon Feb 10 14:09:44 CET 2014


# HG changeset patch
# User Sagar Kotecha <sagar at multicorewareinc.com>
# Date 1392033298 -19800
#      Mon Feb 10 17:24:58 2014 +0530
# Node ID fdd1fddc7e9823a3cc8b93d08af1a9a7e32b44c9
# Parent  2fc9c0a085347bf67e7f2865d8ea434d93b82a86
Fix: Crash of 8 bit video clip in HIGH_BIT_DEPTH mode

diff -r 2fc9c0a08534 -r fdd1fddc7e98 source/Lib/TLibCommon/TComPicYuv.cpp
--- a/source/Lib/TLibCommon/TComPicYuv.cpp	Sat Feb 08 22:50:38 2014 +0900
+++ b/source/Lib/TLibCommon/TComPicYuv.cpp	Mon Feb 10 17:24:58 2014 +0530
@@ -223,7 +223,7 @@
         {
             for (int c = 0; c < width; c++)
             {
-                Y[c] = (Pel)y[c];
+                Y[c] = (Pel)Clip3((uint16_t)0, (uint16_t)((1 << X265_DEPTH) - 1), y[c]);
             }
 
             for (int x = 0; x < padx; x++)
@@ -239,8 +239,8 @@
         {
             for (int c = 0; c < width >> m_hChromaShift; c++)
             {
-                U[c] = (Pel)u[c];
-                V[c] = (Pel)v[c];
+                U[c] = (Pel)Clip3((uint16_t)0, (uint16_t)((1 << X265_DEPTH) - 1), u[c]);
+                V[c] = (Pel)Clip3((uint16_t)0, (uint16_t)((1 << X265_DEPTH) - 1), v[c]);
             }
 
             for (int x = 0; x < padx >> m_hChromaShift; x++)


More information about the x265-devel mailing list