[FFmpeg-cvslog] ffmpeg: check samplerate from decoder.

Michael Niedermayer git at videolan.org
Fri Mar 23 11:25:50 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Mar 23 10:59:03 2012 +0100| [1664edb99859d0a9dfb8dc046f6ed922db301f78] | committer: Michael Niedermayer

ffmpeg: check samplerate from decoder.

Fixes FPE

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1664edb99859d0a9dfb8dc046f6ed922db301f78
---

 ffmpeg.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 0f6bc30..9fd6b42 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2007,6 +2007,10 @@ static int transcode_audio(InputStream *ist, AVPacket *pkt, int *got_output)
     if (ret < 0) {
         return ret;
     }
+    if (avctx->sample_rate <= 0) {
+        av_log(avctx, AV_LOG_ERROR, "Sample rate %d invalid\n", avctx->sample_rate);
+        return AVERROR_INVALIDDATA;
+    }
 
     if (!*got_output) {
         /* no audio frame */



More information about the ffmpeg-cvslog mailing list