summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-12-03 23:37:27 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-12-03 23:37:27 +0100
commit020d53ebdb581ea5a493239537cb0f5cc54809e9 (patch)
treeaadc41659b39e3a38278b654d060c3f263849d4b
parent9859f54db3d24148826f2543367d06a3b77a9725 (diff)
downloadffmpeg-streaming-020d53ebdb581ea5a493239537cb0f5cc54809e9.zip
ffmpeg-streaming-020d53ebdb581ea5a493239537cb0f5cc54809e9.tar.gz
avcodec/flac: Check bps in ff_flac_parse_streaminfo()
-rw-r--r--libavcodec/flac.c5
1 files changed, 5 insertions, 0 deletions
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;
OpenPOWER on IntegriCloud