[FFmpeg-cvslog] r15739 - trunk/libavformat/rmdec.c

michael subversion
Wed Oct 29 01:16:50 CET 2008


Author: michael
Date: Wed Oct 29 01:16:50 2008
New Revision: 15739

Log:
Check sub_packet_size against 0 to avoid div by zero later.
Fixes issue473


Modified:
   trunk/libavformat/rmdec.c

Modified: trunk/libavformat/rmdec.c
==============================================================================
--- trunk/libavformat/rmdec.c	(original)
+++ trunk/libavformat/rmdec.c	Wed Oct 29 01:16:50 2008
@@ -138,6 +138,11 @@ static int rm_read_audio_stream_info(AVF
                 return -1;
             }
 
+            if(sub_packet_size <= 0){
+                av_log(s, AV_LOG_ERROR, "sub_packet_size is invalid\n");
+                return -1;
+            }
+
             if (!strcmp(buf, "cook")) st->codec->codec_id = CODEC_ID_COOK;
             else if (!strcmp(buf, "sipr")) st->codec->codec_id = CODEC_ID_SIPR;
             else st->codec->codec_id = CODEC_ID_ATRAC3;




More information about the ffmpeg-cvslog mailing list