diff mbox

[FFmpeg-devel] avcodec/wmalosslessdec: Reset num_saved_bits on error path

Message ID 20180310234431.6871-1-michael@niedermayer.cc
State Accepted
Commit 64c9ce0abc0fd8774b523afda3ddb17c86caa86a
Headers show

Commit Message

Michael Niedermayer March 10, 2018, 11:44 p.m. UTC
Fixes: NULL pointer dereference
Fixes: poc-201803.wav
Found-by: GwanYeong Kim <gy741.kim@gmail.com>

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/wmalosslessdec.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Paul B Mahol March 11, 2018, 8:41 a.m. UTC | #1
On 3/11/18, Michael Niedermayer <michael@niedermayer.cc> wrote:
> Fixes: NULL pointer dereference
> Fixes: poc-201803.wav
> Found-by: GwanYeong Kim <gy741.kim@gmail.com>
>
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/wmalosslessdec.c | 1 +
>  1 file changed, 1 insertion(+)
>

OK
Michael Niedermayer March 12, 2018, 12:31 a.m. UTC | #2
On Sun, Mar 11, 2018 at 09:41:06AM +0100, Paul B Mahol wrote:
> On 3/11/18, Michael Niedermayer <michael@niedermayer.cc> wrote:
> > Fixes: NULL pointer dereference
> > Fixes: poc-201803.wav
> > Found-by: GwanYeong Kim <gy741.kim@gmail.com>
> >
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  libavcodec/wmalosslessdec.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> 
> OK

applied

thx

[...]
diff mbox

Patch

diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c
index 133a3e92d1..59e8929586 100644
--- a/libavcodec/wmalosslessdec.c
+++ b/libavcodec/wmalosslessdec.c
@@ -1148,6 +1148,7 @@  static void save_bits(WmallDecodeCtx *s, GetBitContext* gb, int len,
     if (len <= 0 || buflen > s->max_frame_size) {
         avpriv_request_sample(s->avctx, "Too small input buffer");
         s->packet_loss = 1;
+        s->num_saved_bits = 0;
         return;
     }