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

Wenju He wenju at multicorewareinc.com
Tue Sep 17 21:37:51 CEST 2013


# 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

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()


More information about the x265-devel mailing list