[vlc-commits] demux: avi: check stride width

Francois Cartegnie git at videolan.org
Thu Nov 23 00:25:09 CET 2017


vlc/vlc-2.2 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Nov 23 00:23:41 2017 +0100| [8d621881e63f8b60fca37e3f2439ff8de933de4c] | committer: Francois Cartegnie

demux: avi: check stride width

6298967bf63cccbdc290a78c53dc97df69bd3d71 backport

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

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

diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c
index c4c2409b0b..0359cced47 100644
--- a/modules/demux/avi/avi.c
+++ b/modules/demux/avi/avi.c
@@ -876,11 +876,11 @@ block_t * ReadFrame( demux_t *p_demux, const avi_track_t *tk,
         p_frame->i_buffer -= i_header;
     }
 
-    if ( !tk->i_width_bytes )
-        return p_frame;
-
     const unsigned int i_stride_bytes = ((( (tk->i_width_bytes << 3) + 31) & ~31) >> 3);
 
+    if ( !tk->i_width_bytes || ! i_stride_bytes )
+        return p_frame;
+
     if ( p_frame->i_buffer < i_stride_bytes )
     {
         p_frame->i_buffer = 0;



More information about the vlc-commits mailing list