[vlc-commits] demux: avi: check stride width
Francois Cartegnie
git at videolan.org
Thu Nov 23 00:24:57 CET 2017
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Nov 22 20:16:35 2017 +0100| [6298967bf63cccbdc290a78c53dc97df69bd3d71] | committer: Francois Cartegnie
demux: avi: check stride width
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6298967bf63cccbdc290a78c53dc97df69bd3d71
---
modules/demux/avi/avi.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c
index d11628839a..e08daabe1c 100644
--- a/modules/demux/avi/avi.c
+++ b/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;
More information about the vlc-commits
mailing list