diff options
author | Jai Luthra <me@jailuthra.in> | 2020-02-02 22:03:00 +0300 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2020-02-04 13:19:12 +0300 |
commit | 49cfbedb9d5a35d4701b37e9908172807eb67100 (patch) | |
tree | 56eb223d4325ac5982830348a55d5ef9bb9119f3 /libavcodec/mlpenc.c | |
parent | d6cef144e21763927ae8992221dc587c3398b4ef (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/mlpenc.c')
-rw-r--r-- | libavcodec/mlpenc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/mlpenc.c b/libavcodec/mlpenc.c index 8e45da4569..a9501c694f 100644 --- a/libavcodec/mlpenc.c +++ b/libavcodec/mlpenc.c @@ -987,6 +987,9 @@ static void write_decoding_params(MLPEncodeContext *ctx, PutBitContext *pb, put_bits(pb, 1, 0); } } + if (cp->codebook > 0 && cp->huff_lsbs > 24) { + av_log(ctx->avctx, AV_LOG_ERROR, "Invalid Huff LSBs\n"); + } put_bits(pb, 2, cp->codebook ); put_bits(pb, 5, cp->huff_lsbs); |