[vlc-commits] demux: libavi: fix heap write ofw

Francois Cartegnie git at videolan.org
Thu Oct 9 00:08:09 CEST 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Oct  8 18:48:44 2014 +0200| [dde5f4aff32b81b6cace0a88a3a718147d0f3bf4] | committer: Francois Cartegnie

demux: libavi: fix heap write ofw

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

 modules/demux/avi/libavi.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/demux/avi/libavi.c b/modules/demux/avi/libavi.c
index 5da6f12..d0cfe71 100644
--- a/modules/demux/avi/libavi.c
+++ b/modules/demux/avi/libavi.c
@@ -460,9 +460,10 @@ static int AVI_ChunkRead_strf( stream_t *s, avi_chunk_t *p_chk )
             {
                 p_chk->strf.vids.p_bih->biSize = p_chk->common.i_chunk_size;
             }
-            uint64_t i_extrasize = p_chk->common.i_chunk_size - sizeof(VLC_BITMAPINFOHEADER);
-            if( i_extrasize > 0 )
+            if ( p_chk->common.i_chunk_size > sizeof(VLC_BITMAPINFOHEADER) )
             {
+                uint64_t i_extrasize = p_chk->common.i_chunk_size - sizeof(VLC_BITMAPINFOHEADER);
+
                 /* There's a color palette appended, set up VLC_BITMAPINFO */
                 memcpy( &p_chk->strf.vids.p_bih[1],
                         p_buff + 8 + sizeof(VLC_BITMAPINFOHEADER), /* 8=fourrc+size */



More information about the vlc-commits mailing list