[vlc-commits] demux: avi: fix write/read overflow

Francois Cartegnie git at videolan.org
Thu Nov 16 12:04:15 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Nov 16 11:52:03 2017 +0100| [f571d59273b881dfd8cd69b5ff6913b566e26fb8] | committer: Francois Cartegnie

demux: avi: fix write/read overflow

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

 modules/demux/avi/avi.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c
index 190a6be209..b5cb00fa6f 100644
--- a/modules/demux/avi/avi.c
+++ b/modules/demux/avi/avi.c
@@ -904,6 +904,12 @@ block_t * ReadFrame( demux_t *p_demux, const avi_track_t *tk,
         p_frame->i_buffer--;
     }
 
+    if( i_header >= p_frame->i_buffer )
+    {
+        p_frame->i_buffer = 0;
+        return p_frame;
+    }
+
     /* skip header */
     p_frame->p_buffer += i_header;
     p_frame->i_buffer -= i_header;



More information about the vlc-commits mailing list