[vlc-commits] XCB windowless: fix buffer size validation

Cheng Sun git at videolan.org
Tue Jan 1 16:13:20 CET 2013


npapi-vlc | branch: master | Cheng Sun <chengsun9 at gmail.com> | Sun Dec 30 22:47:34 2012 +0000| [95c844b6106af356cc9c488860675fc200e38716] | committer: Jean-Baptiste Kempf

XCB windowless: fix buffer size validation

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/npapi-vlc.git/?a=commit;h=95c844b6106af356cc9c488860675fc200e38716
---

 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 */



More information about the vlc-commits mailing list