[FFmpeg-cvslog] sonicdec: check decorrelation

Michael Niedermayer git at videolan.org
Thu Mar 21 16:13:25 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Mar 21 15:45:59 2013 +0100| [1426291eb84c23eb0467c857397db8a76e77a003] | committer: Michael Niedermayer

sonicdec: check decorrelation

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/sonic.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c
index fe9f01f..ae7ca4c 100644
--- a/libavcodec/sonic.c
+++ b/libavcodec/sonic.c
@@ -801,6 +801,10 @@ static av_cold int sonic_decode_init(AVCodecContext *avctx)
     if (!s->lossless)
         skip_bits(&gb, 3); // XXX FIXME
     s->decorrelation = get_bits(&gb, 2);
+    if (s->decorrelation != 3 && s->channels != 2) {
+        av_log(avctx, AV_LOG_ERROR, "invalid decorrelation %d\n", s->decorrelation);
+        return AVERROR_INVALIDDATA;
+    }
 
     s->downsampling = get_bits(&gb, 2);
     if (!s->downsampling) {



More information about the ffmpeg-cvslog mailing list