avcodec/wmalosslessdec: Reset num_saved_bits on error path
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 10 Mar 2018 23:13:57 +0000 (00:13 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 12 Mar 2018 00:32:42 +0000 (01:32 +0100)
Fixes: NULL pointer dereference
Fixes: poc-201803.wav
Found-by: GwanYeong Kim <gy741.kim@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/wmalosslessdec.c

index 133a3e9..59e8929 100644 (file)
@@ -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;
     }