diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-10-05 19:34:17 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-12-06 20:30:57 +0100 |
commit | 08a0c3cd179a9da59577846d388ac4f5b64a5ce4 (patch) | |
tree | 247b475a6a49e0086d4b40a5b2b3dcbc86839060 | |
parent | cf5945613fc08086e1a7e51f19e69e0877c01165 (diff) | |
download | ffmpeg-08a0c3cd179a9da59577846d388ac4f5b64a5ce4.tar.gz |
avcodec/ralf: Skip initializing unused filter variables
Fixes: left shift of negative value -1
Fixes: 17890/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RALF_fuzzer-5643307467669504
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f4ecf6c39de9a7cc1dae70cf87c225771001e883)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/ralf.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/ralf.c b/libavcodec/ralf.c index ec5abf20b4..af93cbf4d1 100644 --- a/libavcodec/ralf.c +++ b/libavcodec/ralf.c @@ -234,8 +234,10 @@ static int decode_channel(RALFContext *ctx, GetBitContext *gb, int ch, int *dst = ctx->channel_data[ch]; ctx->filter_params = get_vlc2(gb, set->filter_params.table, 9, 2); - ctx->filter_bits = (ctx->filter_params - 2) >> 6; - ctx->filter_length = ctx->filter_params - (ctx->filter_bits << 6) - 1; + if (ctx->filter_params > 1) { + ctx->filter_bits = (ctx->filter_params - 2) >> 6; + ctx->filter_length = ctx->filter_params - (ctx->filter_bits << 6) - 1; + } if (ctx->filter_params == FILTER_RAW) { for (i = 0; i < length; i++) |