Browse Source

demux: avi: check stride width

Francois Cartegnie 7 years ago
parent
commit
6298967bf6
1 changed files with 4 additions and 4 deletions
  1. 4 4
      modules/demux/avi/avi.c

+ 4 - 4
modules/demux/avi/avi.c

@@ -912,12 +912,12 @@ static block_t * ReadFrame( demux_t *p_demux, const avi_track_t *tk,
     p_frame->p_buffer += i_header;
     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 ( p_frame->i_buffer < i_stride_bytes )
+    if ( !tk->i_width_bytes || !i_stride_bytes )
+        return p_frame;
+
+    if( p_frame->i_buffer < i_stride_bytes )
     {
         p_frame->i_buffer = 0;
         return p_frame;