[FFmpeg-cvslog] xa: abort if number of channels or sample rate is 0

Paul B Mahol git at videolan.org
Wed Jun 26 00:30:58 CEST 2013


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Tue Jun 25 22:24:55 2013 +0000| [ad194b04879cb5c1b489d2453517228cf15eb4e8] | committer: Paul B Mahol

xa: abort if number of channels or sample rate is 0

Fixes #2711.

Signed-off-by: Paul B Mahol <onemda at gmail.com>

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

 libavformat/xa.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/xa.c b/libavformat/xa.c
index 437de3f..43661de 100644
--- a/libavformat/xa.c
+++ b/libavformat/xa.c
@@ -84,6 +84,9 @@ static int xa_read_header(AVFormatContext *s)
     avio_skip(pb, 2);       /* Skip block align */
     avio_skip(pb, 2);       /* Skip bits-per-sample */
 
+    if (!st->codec->channels || !st->codec->sample_rate)
+        return AVERROR_INVALIDDATA;
+
     st->codec->bit_rate = av_clip(15LL * st->codec->channels * 8 *
                                   st->codec->sample_rate / 28, 0, INT_MAX);
 



More information about the ffmpeg-cvslog mailing list