[vlc-devel] [PATCH 2/3] XCB windowless: fix buffer size validation

Cheng Sun chengsun9 at gmail.com
Sun Dec 30 23:47:34 CET 2012


---
 npapi/vlcwindowless_xcb.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/npapi/vlcwindowless_xcb.cpp b/npapi/vlcwindowless_xcb.cpp
index e4fe0eb..6e0d781 100644
--- a/npapi/vlcwindowless_xcb.cpp
+++ b/npapi/vlcwindowless_xcb.cpp
@@ -101,8 +101,9 @@ bool VlcWindowlessXCB::handle_event(void *event)
 
         drawBackground(xgeevent->drawable);
 
-        /* Validate video size */
-        if (m_media_width == 0 || m_media_height == 0)
+        /* Validate video buffer size */
+        if (m_frame_buf.empty() ||
+            m_frame_buf.size() < m_media_width * m_media_height * DEF_PIXEL_BYTES)
             break;
 
         /* Compute the position of the video */
-- 
1.8.0.3




More information about the vlc-devel mailing list