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

github.com/videolan/dav1d.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJanne Grunau <janne-vlc@jannau.net>2018-11-20 10:53:34 +0300
committerJanne Grunau <janne-vlc@jannau.net>2018-11-20 20:48:41 +0300
commite8f5a93e5fff4371bd49f451238681c704cf0fa4 (patch)
tree64d7f0741431e4abb96ff28562c18586e442e566
parent5098b23ab3a98dc2202449dd3bd0c06902c4ff64 (diff)
film_grain: replace left shift of a signed value with a multiplication
Fixes an undefined left shift of a negative value in clusterfuzz-testcase-minimized-dav1d_fuzzer-5707215277654016. Credits to oss-fuzz.
-rw-r--r--src/film_grain_tmpl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/film_grain_tmpl.c b/src/film_grain_tmpl.c
index df826ee..6a32702 100644
--- a/src/film_grain_tmpl.c
+++ b/src/film_grain_tmpl.c
@@ -418,7 +418,7 @@ static void apply_to_row_uv(Dav1dPicture *const out, const Dav1dPicture *const i
int combined = avg * data->uv_luma_mult[uv] + \
*src * data->uv_mult[uv]; \
val = iclip_pixel( (combined >> 6) + \
- (data->uv_offset[uv] << (BITDEPTH - 8)) ); \
+ (data->uv_offset[uv] * (1 << (BITDEPTH - 8))) ); \
} \
\
int noise = round2(scaling[ val ] * (grain), data->scaling_shift); \