summaryrefslogtreecommitdiff
path: root/libavcodec/wmaprodec.c
diff options
context:
space:
mode:
authorSascha Sommer <saschasommer@freenet.de>2011-09-24 20:56:41 +0200
committerSascha Sommer <saschasommer@freenet.de>2011-09-24 21:29:08 +0200
commit780d45473c32fa356c8ce385c3ea4692567c3228 (patch)
tree21608c913250d3e03f606f8ba1147bd6e6a7cc91 /libavcodec/wmaprodec.c
parent43e05685f225f5e14262ed64f9569e70997e38d3 (diff)
Fix segfault in save_bits:
use put_bits_count to get the buffer fill state instead of num_saved_bits as num_saved_bits is sometimes reset when frames are lost (Ticket 495)
Diffstat (limited to 'libavcodec/wmaprodec.c')
-rw-r--r--libavcodec/wmaprodec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index d4ec0c02af..cade842007 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -1436,7 +1436,7 @@ static void save_bits(WMAProDecodeCtx *s, GetBitContext* gb, int len,
init_put_bits(&s->pb, s->frame_data, MAX_FRAMESIZE);
}
- buflen = (s->num_saved_bits + len + 8) >> 3;
+ buflen = (put_bits_count(&s->pb) + len + 8) >> 3;
if (len <= 0 || buflen > MAX_FRAMESIZE) {
av_log_ask_for_sample(s->avctx, "input buffer too small\n");