[FFmpeg-cvslog] vqf: check samplerate, avoid division by 0.

Michael Niedermayer git at videolan.org
Fri Nov 9 18:53:01 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Nov  9 18:04:54 2012 +0100| [e481ba2ed79421d82ed631d187c05c03260c6561] | committer: Michael Niedermayer

vqf: check samplerate, avoid division by 0.

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=e481ba2ed79421d82ed631d187c05c03260c6561
---

 libavformat/vqf.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/vqf.c b/libavformat/vqf.c
index 5fff84e..f1e6aaf 100644
--- a/libavformat/vqf.c
+++ b/libavformat/vqf.c
@@ -175,6 +175,10 @@ static int vqf_read_header(AVFormatContext *s)
         break;
     default:
         st->codec->sample_rate = rate_flag*1000;
+        if (st->codec->sample_rate <= 0) {
+            av_log(s, AV_LOG_ERROR, "sample rate %d is invalid\n", st->codec->sample_rate);
+            return -1;
+        }
         break;
     }
 



More information about the ffmpeg-cvslog mailing list