aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMashiat Sarker Shakkhar <mashiat.sarker@gmail.com>2012-04-30 08:56:35 -0700
committerKostya Shishkov <kostya.shishkov@gmail.com>2012-05-01 14:33:31 +0200
commitf92f4523782be96cd80b4d94d2642d12dd42cf00 (patch)
tree98c6d4fb86ec6228e86f79bf10d0510aa8b72003 /libavcodec
parenta812ed003f75ad8f90035ab3b88369ee7f3e1bd1 (diff)
downloadffmpeg-f92f4523782be96cd80b4d94d2642d12dd42cf00.tar.gz
WMAL: do not start decoding if frame does not end in current packet
This fixes decoding of frames which span more than two packets. Tested with recit24.wma. Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/wmalosslessdec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c
index 1520a06c45..e86645e225 100644
--- a/libavcodec/wmalosslessdec.c
+++ b/libavcodec/wmalosslessdec.c
@@ -1209,8 +1209,8 @@ static int decode_packet(AVCodecContext *avctx, void *data, int *got_frame_ptr,
save_bits(s, gb, num_bits_prev_frame, 1);
/* decode the cross packet frame if it is valid */
- if (!s->packet_loss)
- decode_frame(s);
+ if (num_bits_prev_frame < remaining_packet_bits && !s->packet_loss)
+ decode_frame(s);
} else if (s->num_saved_bits - s->frame_offset) {
av_dlog(avctx, "ignoring %x previously saved bits\n",
s->num_saved_bits - s->frame_offset);