Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Mar 30, 2019. It is now read-only.
/SharpDXPublic archive

Commit1e41b3f

Browse files
committed
Validate blockAlign can be cast to short
1 parentbc90539 commit1e41b3f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

‎Source/SharpDX/Multimedia/WaveFormatAdpcm.cs‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ public WaveFormatAdpcm(int rate, int channels, int blockAlign = 0) : base(rate,
5656
blockAlign=1024;
5757
}
5858

59+
if(rate<=0)thrownewArgumentOutOfRangeException("rate","Must be > 0");
60+
if(channels<=0)thrownewArgumentOutOfRangeException("channels","Must be > 0");
61+
if(blockAlign<=0)thrownewArgumentOutOfRangeException("blockAlign","Must be > 0");
62+
if(blockAlign>Int16.MaxValue)thrownewArgumentOutOfRangeException("blockAlign","Must be < 32767");
63+
5964
waveFormatTag=WaveFormatEncoding.Adpcm;
6065
this.blockAlign=(short)blockAlign;
6166

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp