[FFmpeg-devel,09/11] avcodec/g723_1dec: Fix invalid shift

Submitted by Andreas Rheinhardt on Sept. 19, 2019, 10:17 p.m.

Details

Message ID 20190919221706.16529-10-andreas.rheinhardt@gmail.com
State Accepted
Commit 54e1efda6d67afb11e21e40109c10b447f8d7f3c
Headers show

Commit Message

Andreas Rheinhardt Sept. 19, 2019, 10:17 p.m.
Fixes the FATE-tests g723_1-dec-1, g723_1-dec-2 and g723_1-dec-4.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/g723_1dec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer Sept. 20, 2019, 9:12 p.m.
On Fri, Sep 20, 2019 at 12:17:04AM +0200, Andreas Rheinhardt wrote:
> Fixes the FATE-tests g723_1-dec-1, g723_1-dec-2 and g723_1-dec-4.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavcodec/g723_1dec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

thx

[...]

Patch hide | download patch | download mbox

diff --git a/libavcodec/g723_1dec.c b/libavcodec/g723_1dec.c
index d8bc3f97ac..d1faf92c39 100644
--- a/libavcodec/g723_1dec.c
+++ b/libavcodec/g723_1dec.c
@@ -1010,7 +1010,7 @@  static int g723_1_decode_frame(AVCodecContext *avctx, void *data,
             formant_postfilter(p, lpc, p->audio, out);
         } else { // if output is not postfiltered it should be scaled by 2
             for (i = 0; i < FRAME_LEN; i++)
-                out[i] = av_clip_int16(p->audio[LPC_ORDER + i] << 1);
+                out[i] = av_clip_int16(2 * p->audio[LPC_ORDER + i]);
         }
     }