diff mbox

[FFmpeg-devel,2/2] avcodec/dcaadpcm: fix use of uninitialized variable

Message ID 20170722175012.29555-2-foobaz86@gmail.com
State New
Headers show

Commit Message

foo86 July 22, 2017, 5:50 p.m. UTC
Fixes CID 1409924.
---
 libavcodec/dcaadpcm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Rostislav Pehlivanov July 22, 2017, 6:36 p.m. UTC | #1
On 22 July 2017 at 18:50, foo86 <foobaz86@gmail.com> wrote:

> Fixes CID 1409924.
> ---
>  libavcodec/dcaadpcm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/dcaadpcm.c b/libavcodec/dcaadpcm.c
> index e00f81f011..99cbb40172 100644
> --- a/libavcodec/dcaadpcm.c
> +++ b/libavcodec/dcaadpcm.c
> @@ -80,7 +80,7 @@ static int64_t find_best_filter(const DCAADPCMEncContext
> *s, const int32_t *in,
>  {
>      const premultiplied_coeffs *precalc_data = s->private_data;
>      int i, j, k = 0;
> -    int vq;
> +    int vq = -1;
>      int64_t err;
>      int64_t min_err = 1ll << 62;
>      int64_t corr[15];
> --
> 2.11.0
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

Patch LGTM, tracing what it would do if it fails is it'll just disable
adpcm encoding.
For small patches like these that you're confident with, just push them
directly, no point in waiting for days when you're a maintainer (though
dcheredn1k wrote that code, you should ping him on IRC for patches to the
encoder).
foo86 July 22, 2017, 9:42 p.m. UTC | #2
On Sat, Jul 22, 2017 at 07:36:04PM +0100, Rostislav Pehlivanov wrote:
> On 22 July 2017 at 18:50, foo86 <foobaz86@gmail.com> wrote:
> 
> > Fixes CID 1409924.
> > ---
> >  libavcodec/dcaadpcm.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/dcaadpcm.c b/libavcodec/dcaadpcm.c
> > index e00f81f011..99cbb40172 100644
> > --- a/libavcodec/dcaadpcm.c
> > +++ b/libavcodec/dcaadpcm.c
> > @@ -80,7 +80,7 @@ static int64_t find_best_filter(const DCAADPCMEncContext
> > *s, const int32_t *in,
> >  {
> >      const premultiplied_coeffs *precalc_data = s->private_data;
> >      int i, j, k = 0;
> > -    int vq;
> > +    int vq = -1;
> >      int64_t err;
> >      int64_t min_err = 1ll << 62;
> >      int64_t corr[15];
> > --
> > 2.11.0
> >
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> 
> Patch LGTM, tracing what it would do if it fails is it'll just disable
> adpcm encoding.

Pushed, thanks.

> For small patches like these that you're confident with, just push them
> directly, no point in waiting for days when you're a maintainer (though
> dcheredn1k wrote that code, you should ping him on IRC for patches to the
> encoder).
diff mbox

Patch

diff --git a/libavcodec/dcaadpcm.c b/libavcodec/dcaadpcm.c
index e00f81f011..99cbb40172 100644
--- a/libavcodec/dcaadpcm.c
+++ b/libavcodec/dcaadpcm.c
@@ -80,7 +80,7 @@  static int64_t find_best_filter(const DCAADPCMEncContext *s, const int32_t *in,
 {
     const premultiplied_coeffs *precalc_data = s->private_data;
     int i, j, k = 0;
-    int vq;
+    int vq = -1;
     int64_t err;
     int64_t min_err = 1ll << 62;
     int64_t corr[15];