diff options
author | Sascha Sommer <saschasommer@freenet.de> | 2011-01-15 16:39:52 +0000 |
---|---|---|
committer | Sascha Sommer <saschasommer@freenet.de> | 2011-01-15 16:39:52 +0000 |
commit | f73467192558cadff476c98c73767ec04e7212c3 (patch) | |
tree | 9b0d96a3978632cb37fbb25eb55e43c443d78e39 | |
parent | 462b26202bc167c52159bcf409c0955bfa37134b (diff) | |
download | ffmpeg-streaming-f73467192558cadff476c98c73767ec04e7212c3.zip ffmpeg-streaming-f73467192558cadff476c98c73767ec04e7212c3.tar.gz |
do not read over the end of the packet
fixes issue 2543
Originally committed as revision 26367 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/wmaprodec.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c index 9fc2aba..cf7fc44 100644 --- a/libavcodec/wmaprodec.c +++ b/libavcodec/wmaprodec.c @@ -1506,6 +1506,12 @@ static int decode_packet(AVCodecContext *avctx, s->packet_sequence_number = packet_sequence_number; if (num_bits_prev_frame > 0) { + int remaining_packet_bits = s->buf_bit_size - get_bits_count(gb); + if (num_bits_prev_frame >= remaining_packet_bits) { + num_bits_prev_frame = remaining_packet_bits; + s->packet_done = 1; + } + /** append the previous frame data to the remaining data from the previous packet to create a full frame */ save_bits(s, gb, num_bits_prev_frame, 1); |