diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-12-09 16:29:35 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-02-04 02:26:37 +0100 |
commit | fd00203554334f602ee1d7c5416ff25f356f4fb7 (patch) | |
tree | 4b696ac2f1fc98acff367f0a7848f2cda0be6344 /libavcodec/flacdec.c | |
parent | 8addd56554eb240f38abfadb8bedf3ff8efc965a (diff) | |
download | ffmpeg-fd00203554334f602ee1d7c5416ff25f356f4fb7.tar.gz |
avcodec/flacdec: Check for invalid vlcs
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/flacdec.c')
-rw-r--r-- | libavcodec/flacdec.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c index af81115ff8..0fffc2dd94 100644 --- a/libavcodec/flacdec.c +++ b/libavcodec/flacdec.c @@ -259,7 +259,13 @@ static int decode_residuals(FLACContext *s, int32_t *decoded, int pred_order) *decoded++ = get_sbits_long(&s->gb, tmp); } else { for (; i < samples; i++) { - *decoded++ = get_sr_golomb_flac(&s->gb, tmp, INT_MAX, 0); + int v = get_sr_golomb_flac(&s->gb, tmp, INT_MAX, 0); + if (v == 0x80000000){ + av_log(s->avctx, AV_LOG_ERROR, "invalid residual\n"); + return AVERROR_INVALIDDATA; + } + + *decoded++ = v; } } i= 0; |