[vlc-commits] demux: livavi: fix heap buffer ofw in strf parsing (fix #12359)

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 17:59:23 2014 +0200| [cd87a5a9482adef5c679f80fc3a75eccbd7c6970] | committer: Francois Cartegnie

demux: livavi: fix heap buffer ofw in strf parsing (fix #12359)

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

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

diff --git a/modules/demux/avi/libavi.c b/modules/demux/avi/libavi.c
index 79cd34b..5da6f12 100644
--- a/modules/demux/avi/libavi.c
+++ b/modules/demux/avi/libavi.c
@@ -471,12 +471,12 @@ static int AVI_ChunkRead_strf( stream_t *s, avi_chunk_t *p_chk )
                 if ( !p_chk->strf.vids.p_bih->biClrUsed )
                     p_chk->strf.vids.p_bih->biClrUsed = (1 << p_chk->strf.vids.p_bih->biBitCount);
 
-                if( i_extrasize > (UINT32_MAX * sizeof(uint32_t)) )
+                if( i_extrasize / sizeof(uint32_t) > UINT32_MAX )
                     p_chk->strf.vids.p_bih->biClrUsed = UINT32_MAX;
                 else
                 {
                     p_chk->strf.vids.p_bih->biClrUsed =
-                            __MAX( i_extrasize / sizeof(uint32_t),
+                            __MIN( i_extrasize / sizeof(uint32_t),
                                    p_chk->strf.vids.p_bih->biClrUsed );
                 }
 



More information about the vlc-commits mailing list