aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-03-11 00:13:57 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2018-07-08 19:45:45 +0200
commit7a5630b56a8bb0422c3946601e2c95cd6ea53956 (patch)
tree422646b14e7093d95ce04635063fc7ec2b8d030c
parent791c0940f588ba10a460b2d3eb4e927b922fef8d (diff)
downloadffmpeg-7a5630b56a8bb0422c3946601e2c95cd6ea53956.tar.gz
avcodec/wmalosslessdec: Reset num_saved_bits on error path
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> (cherry picked from commit 64c9ce0abc0fd8774b523afda3ddb17c86caa86a) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/wmalosslessdec.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c
index 7eb7b4cd30..df21662d05 100644
--- a/libavcodec/wmalosslessdec.c
+++ b/libavcodec/wmalosslessdec.c
@@ -1149,6 +1149,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;
}