aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-12-22 03:12:03 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2017-12-30 21:11:32 +0100
commitb66e3e321f64a659a534e520c5fad085e8c293f5 (patch)
treed31fcea63ae424e7b6efdbc7c1694a1cc1a5016e
parent1d9830cba30dfa1ff44f5227763e9d5257841854 (diff)
downloadffmpeg-b66e3e321f64a659a534e520c5fad085e8c293f5.tar.gz
avcodec/hevcdsp_template.c: Fix undefined shift in FUNC(dequant)
Fixes: runtime error: left shift of negative value -180 Fixes: 4626/clusterfuzz-testcase-minimized-5647837887987712 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 0c9ab5ef9c1ee852c80c859c9e07efe8730b57ed) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/hevcdsp_template.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/hevcdsp_template.c b/libavcodec/hevcdsp_template.c
index 4017af8eb0..903aa3fe95 100644
--- a/libavcodec/hevcdsp_template.c
+++ b/libavcodec/hevcdsp_template.c
@@ -121,7 +121,7 @@ static void FUNC(dequant)(int16_t *coeffs, int16_t log2_size)
} else {
for (y = 0; y < size; y++) {
for (x = 0; x < size; x++) {
- *coeffs = *coeffs << -shift;
+ *coeffs = *(uint16_t*)coeffs << -shift;
coeffs++;
}
}