OSDN Git Service

rl2demux: Fix FPE
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 18 Dec 2011 22:54:56 +0000 (23:54 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 18 Dec 2011 22:54:56 +0000 (23:54 +0100)
Fixes Ticket788
Bug found by Oana Stratulat

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/rl2.c

index 530e0df..78edec5 100644 (file)
@@ -138,6 +138,9 @@ static av_cold int rl2_read_header(AVFormatContext *s,
 
     /** setup audio stream if present */
     if(sound_rate){
+        if(channels <= 0)
+            return AVERROR_INVALIDDATA;
+
         pts_num = def_sound_size;
         pts_den = rate;