[x265] [PATCH] fix allocation crash if input y4m file is not found

Steve Borho steve at borho.org
Wed Sep 18 04:33:19 CEST 2013


On Tue, Sep 17, 2013 at 2:37 PM, Wenju He <wenju at multicorewareinc.com>wrote:

> # HG changeset patch
> # User Wenju He <wenju at multicorewareinc.com>
> # Date 1379446629 18000
> #      Tue Sep 17 14:37:09 2013 -0500
> # Node ID a51641ea0344cdbd17d7d8195fc5753d77e9bdc6
> # Parent  97e1bed019a62849c5cc514ee74efbf64647986c
> fix allocation crash if input y4m file is not found
>

Thanks, pushed.  Optimally parseHeader() would return a bool whether the
dimensions were correctly read from the file, and we would check that as
well.


> diff -r 97e1bed019a6 -r a51641ea0344 source/input/y4m.cpp
> --- a/source/input/y4m.cpp      Tue Sep 17 13:41:27 2013 -0500
> +++ b/source/input/y4m.cpp      Tue Sep 17 14:37:09 2013 -0500
> @@ -33,8 +33,10 @@
>  {
>      ifs.open(filename, ios::binary | ios::in);
>      if (!ifs.fail())
> +    {
>          parseHeader();
> -    buf = new char[3 * width * height / 2];
> +        buf = new char[3 * width * height / 2];
> +    }
>  }
>
>  Y4MInput::~Y4MInput()
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel
>



-- 
Steve Borho
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20130917/2e2e75da/attachment.html>


More information about the x265-devel mailing list