[x265-commits] [x265] nal: include the start code bytes in the bounds check

Steve Borho steve at borho.org
Fri Jun 20 08:11:25 CEST 2014


details:   http://hg.videolan.org/x265/rev/cc0beb898def
branches:  
changeset: 7145:cc0beb898def
user:      Steve Borho <steve at borho.org>
date:      Fri Jun 20 01:11:09 2014 -0500
description:
nal: include the start code bytes in the bounds check

diffstat:

 source/encoder/nal.cpp |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 57f26a8b7ecb -r cc0beb898def source/encoder/nal.cpp
--- a/source/encoder/nal.cpp	Fri Jun 20 00:56:00 2014 -0500
+++ b/source/encoder/nal.cpp	Fri Jun 20 01:11:09 2014 -0500
@@ -128,7 +128,7 @@ void NALList::serialize(NalUnitType nalU
         out[bytes++] = bpayload[i];
     }
 
-    X265_CHECK(bytes <= 2 + payloadSize + (payloadSize >> 1), "NAL buffer overflow\n");
+    X265_CHECK(bytes <= 4 + 2 + payloadSize + (payloadSize >> 1), "NAL buffer overflow\n");
 
     if (m_extraOccupancy)
     {


More information about the x265-commits mailing list