[x265] [PATCH] Patch for issue #422 - Credit to Dimitry Andric

Ashok Kumar Mishra ashok at multicorewareinc.com
Thu Aug 16 15:44:50 CEST 2018


On Thu, Aug 16, 2018 at 6:27 PM, <praveen at multicorewareinc.com> wrote:

> # HG changeset patch
> # User Praveen Tiwari <praveen at multicorewareinc.com>
> # Date 1534424221 -19800
> #      Thu Aug 16 18:27:01 2018 +0530
> # Node ID 88ee12651e3031dc1fc2f3f6a8bbac5f67839579
> # Parent  cbc24109c1c849c027b5f087c6ff5f2087cb7301
> Patch for issue #422 - Credit to Dimitry Andric.
>
> This is due to undefined behavior in cuTreeFix8Pack(), where a double
> value is cast directly to uint16_t.  If the double value is negative,
> the resulting value from the cast is undefined.
>
> diff -r cbc24109c1c8 -r 88ee12651e30 source/common/pixel.cpp
> --- a/source/common/pixel.cpp   Tue Aug 14 18:01:51 2018 +0530
> +++ b/source/common/pixel.cpp   Thu Aug 16 18:27:01 2018 +0530
> @@ -922,7 +922,7 @@
>  static void cuTreeFix8Pack(uint16_t *dst, double *src, int count)
>  {
>      for (int i = 0; i < count; i++)
> -        dst[i] = (uint16_t)(src[i] * 256.0);
> +        dst[i] = (uint16_t)(int16_t)(src[i] * 256.0);
>  }
>
>  static void cuTreeFix8Unpack(double *dst, uint16_t *src, int count)
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel
>

Pushed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20180816/681953f9/attachment-0001.html>


More information about the x265-devel mailing list