From c3615119ba2e486006acbbe96875c6be0fb020df Mon Sep 17 00:00:00 2001 From: Tom Ross Date: Sat, 20 Dec 2008 06:16:22 +0000 Subject: [PATCH] Don't read a full byte if less than 8 bits are available. The change doesn't fix any problem samples, but the current code makes no sense. Also some spelling corrections in debugfs and comments. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19502 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/libwma/wmadeci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/codecs/libwma/wmadeci.c b/apps/codecs/libwma/wmadeci.c index 2697db0d8d..eb29b1284b 100644 --- a/apps/codecs/libwma/wmadeci.c +++ b/apps/codecs/libwma/wmadeci.c @@ -1542,7 +1542,7 @@ int wma_decode_superframe_frame(WMADecodeContext* s, } q = s->last_superframe + s->last_superframe_len; len = s->bit_offset; - while (len > 0) + while (len > 7) { *q++ = (get_bits)(&s->gb, 8); len -= 8; @@ -1597,7 +1597,7 @@ int wma_decode_superframe_frame(WMADecodeContext* s, len = buf_size - pos; if (len > MAX_CODED_SUPERFRAME_SIZE || len < 0) { - DEBUGF("superframe size too large error after decodeing\n"); + DEBUGF("superframe size too large error after decoding\n"); goto fail; } s->last_superframe_len = len;