aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-03-25 01:51:28 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2018-07-08 19:45:46 +0200
commit3d329dc8c3f1285e7ded4fd234ab0eac637ed69f (patch)
tree351292a4b55bb5fb32a24db8378581266bd49771 /libavcodec
parenta3ffdf43e659f9d016bae45823a918c0af68a9d2 (diff)
downloadffmpeg-3d329dc8c3f1285e7ded4fd234ab0eac637ed69f.tar.gz
avcodec/wmalosslessdec: Fix null pointer dereference in decode_frame()
Fixes: 2018_03_23_poc.wav Found-by: GwanYeong Kim <gy741.kim@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit ea15915b2dc5aaa80c91879fbd183475a7e66e54) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/wmalosslessdec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c
index df21662d05..0f50bbd480 100644
--- a/libavcodec/wmalosslessdec.c
+++ b/libavcodec/wmalosslessdec.c
@@ -1257,7 +1257,9 @@ static int decode_packet(AVCodecContext *avctx, void *data, int *got_frame_ptr,
(frame_size = show_bits(gb, s->log2_frame_size)) &&
frame_size <= remaining_bits(s, gb)) {
save_bits(s, gb, frame_size, 0);
- s->packet_done = !decode_frame(s);
+
+ if (!s->packet_loss)
+ s->packet_done = !decode_frame(s);
} else if (!s->len_prefix
&& s->num_saved_bits > get_bits_count(&s->gb)) {
/* when the frames do not have a length prefix, we don't know the