avcodec/g723_1dec: Fix LCG type
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 14 May 2017 12:00:42 +0000 (14:00 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 14 May 2017 13:30:08 +0000 (15:30 +0200)
Fixes: 1567/clusterfuzz-testcase-minimized-5693653555085312

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

index 89089f5..aaa26c2 100644 (file)
@@ -488,7 +488,7 @@ static void residual_interp(int16_t *buf, int16_t *out, int lag,
                           (FRAME_LEN - lag) * sizeof(*out));
     } else {  /* Unvoiced */
         for (i = 0; i < FRAME_LEN; i++) {
-            *rseed = *rseed * 521 + 259;
+            *rseed = (int16_t)(*rseed * 521 + 259);
             out[i] = gain * *rseed >> 15;
         }
         memset(buf, 0, (FRAME_LEN + PITCH_MAX) * sizeof(*buf));