avcodec/lcldec: Check mthread_inlen instead of cliping
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 27 Jul 2019 21:24:25 +0000 (23:24 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 23 Aug 2019 20:24:07 +0000 (22:24 +0200)
commit4d4734bdc881de3af0ebe5935890a81423c80fdf
treee6be2b2b119e571a8a9ca65eaed479761b55eb86
parent965e766e4892cfc45c97cca88895248a7735e7d0
avcodec/lcldec: Check mthread_inlen instead of cliping

Clipping was added in 2009 to avoid crashes.
The clipped case would produce a 2nd slice with 0 input
thus also producing 0 output.
Subsequent checks will cause decoder failure unless both
slices have the same output length. thus the only way this
would not already fail is if the output from both slices
was 0 bytes.

Fixes: Timeout (134sec -> 241ms)
Fixes: 15599/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MSZH_fuzzer-5658127116009472

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/lcldec.c