[vlc-commits] h264_nal: Fix a boundary check in the H264 bitstream conversion routine

Martin Storsjö git at videolan.org
Mon Mar 18 21:10:34 CET 2013


vlc | branch: master | Martin Storsjö <martin at martin.st> | Mon Mar 18 21:13:58 2013 +0200| [567597b43238a9092409118636352bd434d142a6] | committer: Martin Storsjö

h264_nal: Fix a boundary check in the H264 bitstream conversion routine

Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=567597b43238a9092409118636352bd434d142a6
---

 modules/codec/h264_nal.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/codec/h264_nal.h b/modules/codec/h264_nal.h
index e0b6c98..ed9f6ae 100644
--- a/modules/codec/h264_nal.h
+++ b/modules/codec/h264_nal.h
@@ -114,7 +114,7 @@ static void convert_h264_to_annexb( uint8_t *p_buf, uint32_t i_len,
             p_buf[i] = 0;
         }
         p_buf[i_nal_size - 1] = 1;
-        if( nal_len > INT_MAX || nal_len > (unsigned int) i_len )
+        if( nal_len > INT_MAX || nal_len + i_nal_size > (unsigned int) i_len )
             break;
         p_buf += nal_len + i_nal_size;
         i_len -= nal_len + i_nal_size;



More information about the vlc-commits mailing list