[vlc-commits] demux: asf: add packet values check.

Francois Cartegnie git at videolan.org
Sat Feb 8 17:04:45 CET 2014


vlc/vlc-2.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Nov 27 14:17:24 2013 +0100| [ea068d7322cd32be5ab6180ab988c716c0f55514] | committer: Felix Paul Kühne

demux: asf: add packet values check.

div by zero in many places

(cherry picked from commit 98787d0843612271e99d62bee0dfd8197f0cf404)
Signed-off-by: Felix Paul Kühne <fkuehne at videolan.org>

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

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

diff --git a/modules/demux/asf/libasf.c b/modules/demux/asf/libasf.c
index fdf1c14..e4666e5 100644
--- a/modules/demux/asf/libasf.c
+++ b/modules/demux/asf/libasf.c
@@ -311,8 +311,8 @@ static int ASF_ReadObject_file_properties( stream_t *s, asf_object_t *p_obj )
     p_fp->i_send_duration = GetQWLE( p_peek + 72 );
     p_fp->i_preroll = GetQWLE( p_peek + 80 );
     p_fp->i_flags = GetDWLE( p_peek + 88 );
-    p_fp->i_min_data_packet_size = GetDWLE( p_peek + 92 );
-    p_fp->i_max_data_packet_size = GetDWLE( p_peek + 96 );
+    p_fp->i_min_data_packet_size = __MAX( GetDWLE( p_peek + 92 ), (uint32_t) 1 );
+    p_fp->i_max_data_packet_size = __MAX( GetDWLE( p_peek + 96 ), (uint32_t) 1 );
     p_fp->i_max_bitrate = GetDWLE( p_peek + 100 );
 
 #ifdef ASF_DEBUG



More information about the vlc-commits mailing list