• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqtwindows誰得cocoapythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

Commit MetaInfo

修订版b30ceee5421a97fd3b59525b79bd3a9542e09c71 (tree)
时间2021-10-18 22:12:12
作者yyagi <yyagi.dtxmania@gmai...>
Commiteryyagi

Log Message

#43056 oggのデコードでもmp3/wavと同じミス(ヘッダのオーバーライト)をしていたので修正。

更改概述

  • delete: "FDK/\343\202\263\343\203\274\343\203\211/03.\343\202\265\343\202\246\343\203\263\343\203\211/Cogg.cs"

差异

--- "a/FDK/\343\202\263\343\203\274\343\203\211/03.\343\202\265\343\202\246\343\203\263\343\203\211/Cogg.cs"
+++ "b/FDK/\343\202\263\343\203\274\343\203\211/03.\343\202\265\343\202\246\343\203\263\343\203\211/Cogg.cs"
@@ -70,9 +70,14 @@ namespace FDK
7070 // create a buffer for reading samples
7171 var readBuffer = new float[vorbis.Channels * vorbis.SampleRate * 5]; // 5sec buffer
7272
73+ for ( int i = 0; i < offset; i++ )
74+ {
75+ Dest[ i ] = 0;
76+ }
77+
7378 // go grab samples
7479 int cnt;
75- int p = 0;
80+ int p = (int)offset;
7681 while ((cnt = vorbis.ReadSamples(readBuffer, 0, readBuffer.Length)) > 0)
7782 {
7883 bool bEnd = false;
@@ -80,9 +85,9 @@ namespace FDK
8085 // samples are interleaved (chan0, chan1, chan0, chan1, etc.)
8186 // sample value range is -0.99999994f to 0.99999994f unless vorbis.ClipSamples == false
8287
83- if (Dest.Length < p + cnt * 4)
88+ if (Dest.Length + offset < p + cnt * 4)
8489 {
85- cnt = (Dest.Length - p) / 4;
90+ cnt = (Dest.Length +(int) offset - p) / 4;
8691 bEnd = true;
8792 }
8893 Buffer.BlockCopy(readBuffer, 0, Dest, p, cnt * 4);