[FFmpeg-cvslog] avcodec/flac: Check bps in ff_flac_parse_streaminfo()

Michael Niedermayer git at videolan.org
Sun Dec 4 02:03:43 EET 2016


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sat Dec  3 23:37:27 2016 +0100| [020d53ebdb581ea5a493239537cb0f5cc54809e9] | committer: Michael Niedermayer

avcodec/flac: Check bps in ff_flac_parse_streaminfo()

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

 libavcodec/flac.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/flac.c b/libavcodec/flac.c
index f5154b9..069cde4 100644
--- a/libavcodec/flac.c
+++ b/libavcodec/flac.c
@@ -222,6 +222,11 @@ void ff_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s,
     s->channels = get_bits(&gb, 3) + 1;
     s->bps = get_bits(&gb, 5) + 1;
 
+    if (s->bps < 4) {
+        av_log(avctx, AV_LOG_ERROR, "invalid bps: %d\n", s->bps);
+        s->bps = 16;
+    }
+
     avctx->channels = s->channels;
     avctx->sample_rate = s->samplerate;
     avctx->bits_per_raw_sample = s->bps;



More information about the ffmpeg-cvslog mailing list