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

Francois Cartegnie git at videolan.org
Thu Oct 9 13:41:35 CEST 2014


vlc/vlc-2.2 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Oct  8 18:48:44 2014 +0200| [1530ef4fdb3e444bf939cc9cb2e46df4b1e6022f] | committer: Jean-Baptiste Kempf

demux: libavi: fix heap write ofw

(cherry picked from commit dde5f4aff32b81b6cace0a88a3a718147d0f3bf4)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 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