Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJai Luthra <me@jailuthra.in>2020-02-02 22:03:00 +0300
committerPaul B Mahol <onemda@gmail.com>2020-02-04 13:19:12 +0300
commit49cfbedb9d5a35d4701b37e9908172807eb67100 (patch)
tree56eb223d4325ac5982830348a55d5ef9bb9119f3 /libavcodec/mlpdec.c
parentd6cef144e21763927ae8992221dc587c3398b4ef (diff)
mlp: check huff_lsbs only when codebook is used
When no codebook is used, huff_lsbs can be more than 24 and still decode to original values once filters are applied. Signed-off-by: Jai Luthra <me@jailuthra.in>
Diffstat (limited to 'libavcodec/mlpdec.c')
-rw-r--r--libavcodec/mlpdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c
index 39c40914cd..22a6efd63d 100644
--- a/libavcodec/mlpdec.c
+++ b/libavcodec/mlpdec.c
@@ -829,7 +829,7 @@ static int read_channel_params(MLPDecodeContext *m, unsigned int substr,
cp->codebook = get_bits(gbp, 2);
cp->huff_lsbs = get_bits(gbp, 5);
- if (cp->huff_lsbs > 24) {
+ if (cp->codebook > 0 && cp->huff_lsbs > 24) {
av_log(m->avctx, AV_LOG_ERROR, "Invalid huff_lsbs.\n");
cp->huff_lsbs = 0;
return AVERROR_INVALIDDATA;