OSDN Git Service

#43056 oggのデコードでのオフセット設定ミスを修正。
authoryyagi <yyagi.dtxmania@gmail.com>
Mon, 18 Oct 2021 15:56:47 +0000 (00:56 +0900)
committeryyagi <yyagi.dtxmania@gmail.com>
Mon, 18 Oct 2021 15:56:47 +0000 (00:56 +0900)
FDK/コード/03.サウンド/Cogg.cs

index 06039d8..2f5d477 100644 (file)
@@ -85,9 +85,9 @@ namespace FDK
                                // samples are interleaved (chan0, chan1, chan0, chan1, etc.)
                                // sample value range is -0.99999994f to 0.99999994f unless vorbis.ClipSamples == false
 
-                               if (Dest.Length + offset < p + cnt * 4)
+                               if (Dest.Length < p + cnt * 4)
                                {
-                                       cnt = (Dest.Length +(int) offset - p) / 4;
+                                       cnt = (Dest.Length - p) / 4;
                                        bEnd = true;
                                }
                                Buffer.BlockCopy(readBuffer, 0, Dest, p, cnt * 4);