diff options
author | Andree Buschmann <AndreeBuschmann@t-online.de> | 2011-06-24 08:51:22 +0000 |
---|---|---|
committer | Andree Buschmann <AndreeBuschmann@t-online.de> | 2011-06-24 08:51:22 +0000 |
commit | 4b0e09c1ac2127151b100723ebe6233ee7757e6a (patch) | |
tree | 138d7d30cc48a9879fa4a22c0968ab5a6b9508e2 /apps/codecs | |
parent | d0084ffd7a4a8f14aeb2c702de5794e36ffff6e8 (diff) | |
download | rockbox-4b0e09c1ac2127151b100723ebe6233ee7757e6a.tar.gz rockbox-4b0e09c1ac2127151b100723ebe6233ee7757e6a.zip |
Submit FS#12164 by Sean Bartell with minor changes by myself. Fixes possible decoding corruption of RealAudio files.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30060 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs')
-rw-r--r-- | apps/codecs/atrac3_rm.c | 2 | ||||
-rw-r--r-- | apps/codecs/cook.c | 2 | ||||
-rw-r--r-- | apps/codecs/librm/rm.c | 5 |
3 files changed, 5 insertions, 4 deletions
diff --git a/apps/codecs/atrac3_rm.c b/apps/codecs/atrac3_rm.c index b666dd4513..997507425e 100644 --- a/apps/codecs/atrac3_rm.c +++ b/apps/codecs/atrac3_rm.c | |||
@@ -89,7 +89,7 @@ enum codec_status codec_run(void) | |||
89 | fs = rmctx.audio_framesize; | 89 | fs = rmctx.audio_framesize; |
90 | sps= rmctx.block_align; | 90 | sps= rmctx.block_align; |
91 | h = rmctx.sub_packet_h; | 91 | h = rmctx.sub_packet_h; |
92 | scrambling_unit_size = h*fs; | 92 | scrambling_unit_size = h * (fs + PACKET_HEADER_SIZE); |
93 | 93 | ||
94 | res = atrac3_decode_init(&q, ci->id3); | 94 | res = atrac3_decode_init(&q, ci->id3); |
95 | if(res < 0) { | 95 | if(res < 0) { |
diff --git a/apps/codecs/cook.c b/apps/codecs/cook.c index 5801ee63af..4a47e74f60 100644 --- a/apps/codecs/cook.c +++ b/apps/codecs/cook.c | |||
@@ -88,7 +88,7 @@ enum codec_status codec_run(void) | |||
88 | fs = rmctx.audio_framesize; | 88 | fs = rmctx.audio_framesize; |
89 | sps= rmctx.block_align; | 89 | sps= rmctx.block_align; |
90 | h = rmctx.sub_packet_h; | 90 | h = rmctx.sub_packet_h; |
91 | scrambling_unit_size = h*fs; | 91 | scrambling_unit_size = h * (fs + PACKET_HEADER_SIZE); |
92 | 92 | ||
93 | res =cook_decode_init(&rmctx, &q); | 93 | res =cook_decode_init(&rmctx, &q); |
94 | if(res < 0) { | 94 | if(res < 0) { |
diff --git a/apps/codecs/librm/rm.c b/apps/codecs/librm/rm.c index 6bc187bb5e..eabbe5d92a 100644 --- a/apps/codecs/librm/rm.c +++ b/apps/codecs/librm/rm.c | |||
@@ -541,8 +541,9 @@ int rm_get_packet(uint8_t **src,RMContext *rmctx, RMPacket *pkt) | |||
541 | if (!y) | 541 | if (!y) |
542 | rmctx->audiotimestamp = pkt->timestamp; | 542 | rmctx->audiotimestamp = pkt->timestamp; |
543 | 543 | ||
544 | advance_buffer(src,12); | 544 | /* Skip packet header */ |
545 | consumed += 12; | 545 | advance_buffer(src, PACKET_HEADER_SIZE); |
546 | consumed += PACKET_HEADER_SIZE; | ||
546 | if (rmctx->codec_type == CODEC_COOK || rmctx->codec_type == CODEC_ATRAC) { | 547 | if (rmctx->codec_type == CODEC_COOK || rmctx->codec_type == CODEC_ATRAC) { |
547 | for(x = 0 ; x < w/sps; x++) | 548 | for(x = 0 ; x < w/sps; x++) |
548 | { | 549 | { |