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

Francois Cartegnie git at videolan.org
Mon Jan 27 17:02:38 CET 2014


vlc/vlc-2.1 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Nov 27 14:17:24 2013 +0100| [489adeaa7654e86d5a366a8dfa2f4629a056c043] | committer: Jean-Baptiste Kempf

demux: asf: add packet values check.

div by zero in many places

(cherry picked from commit 98787d0843612271e99d62bee0dfd8197f0cf404)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 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 dcc9b73..d7fa231 100644
--- a/modules/demux/asf/libasf.c
+++ b/modules/demux/asf/libasf.c
@@ -319,8 +319,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