Mercurial > libavcodec.hg
comparison wmadec.c @ 3362:c43fcf831f7c libavcodec
Do not read full byte when less than 8 bits are still to be read.
Does not make a difference with any of my samples, but current
code does not make much sense.
author | reimar |
---|---|
date | Tue, 27 Jun 2006 12:13:01 +0000 |
parents | bcaa5113e311 |
children | 5ea82888103e |
comparison
equal
deleted
inserted
replaced
3361:bcaa5113e311 | 3362:c43fcf831f7c |
---|---|
1237 if ((s->last_superframe_len + ((bit_offset + 7) >> 3)) > | 1237 if ((s->last_superframe_len + ((bit_offset + 7) >> 3)) > |
1238 MAX_CODED_SUPERFRAME_SIZE) | 1238 MAX_CODED_SUPERFRAME_SIZE) |
1239 goto fail; | 1239 goto fail; |
1240 q = s->last_superframe + s->last_superframe_len; | 1240 q = s->last_superframe + s->last_superframe_len; |
1241 len = bit_offset; | 1241 len = bit_offset; |
1242 while (len > 0) { | 1242 while (len > 7) { |
1243 *q++ = (get_bits)(&s->gb, 8); | 1243 *q++ = (get_bits)(&s->gb, 8); |
1244 len -= 8; | 1244 len -= 8; |
1245 } | 1245 } |
1246 if (len > 0) { | 1246 if (len > 0) { |
1247 *q++ = (get_bits)(&s->gb, len) << (8 - len); | 1247 *q++ = (get_bits)(&s->gb, len) << (8 - len); |