[vlc-devel] commit: Protect against division by 0 on corrupted file (real). ( Laurent Aimar )

git version control git at videolan.org
Sun Dec 14 17:24:03 CET 2008


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Dec 14 17:23:28 2008 +0100| [5ba06d3f71805cf58a4fd55cfc298e456efaea75] | committer: Laurent Aimar 

Protect against division by 0 on corrupted file (real).

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

 modules/demux/real.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/modules/demux/real.c b/modules/demux/real.c
index a9a4597..7d09aa9 100644
--- a/modules/demux/real.c
+++ b/modules/demux/real.c
@@ -1481,7 +1481,8 @@ static int CodecAudioParse( demux_t *p_demux, int i_tk_id, const uint8_t *p_data
         fmt.audio.i_flavor = i_flavor;
     case VLC_FOURCC('c','o','o','k'):
     case VLC_FOURCC('a','t','r','c'):
-        if( i_subpacket_size <= 0 )
+        if( i_subpacket_size <= 0 ||
+            i_frame_size / i_subpacket_size <= 0 )
         {
             es_format_Clean( &fmt );
             return VLC_EGENERIC;




More information about the vlc-devel mailing list