[SCM] libav/experimental: Check sub_packet_size against 0 to avoid div by zero later. Fixes issue473

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:31:55 UTC 2013


The following commit has been merged in the experimental branch:
commit f23938f5b799e8859693aec1ce55ef04490c6aab
Author: Michael Niedermayer <michaelni at gmx.at>
Date:   Wed Oct 29 00:16:50 2008 +0000

    Check sub_packet_size against 0 to avoid div by zero later.
    Fixes issue473
    
    Originally committed as revision 15739 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index 8442957..9db09e1 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -138,6 +138,11 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVStream *st,
                 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;

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list