Changeset 4e72534d7da8bb2cda63791ffe4d611e7dcf0929
- Timestamp:
- 06/29/08 18:23:12
(2 months ago)
- Author:
- Laurent Aimar <fenrir@videolan.org>
- git-committer:
- Laurent Aimar <fenrir@videolan.org> 1214756592 +0000
- git-parent:
[37402ad5d32c33a0f6f76eda0cb39d6b2339062e]
- git-author:
- Laurent Aimar <fenrir@videolan.org> 1214756592 +0000
- Message:
Check against too low sample rate and 0 channel count (avoid division by 0)
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| re0c708f |
r4e72534 |
|
| 60 | 60 | return NULL; |
|---|
| 61 | 61 | } |
|---|
| | 62 | if( p_format->i_channels <= 0 ) |
|---|
| | 63 | { |
|---|
| | 64 | msg_Err( p_aout, "no audio channels" ); |
|---|
| | 65 | return NULL; |
|---|
| | 66 | } |
|---|
| 62 | 67 | |
|---|
| 63 | 68 | if( p_format->i_rate > 192000 ) |
|---|
| 64 | 69 | { |
|---|
| 65 | 70 | msg_Err( p_aout, "excessive audio sample frequency (%u)", |
|---|
| | 71 | p_format->i_rate ); |
|---|
| | 72 | return NULL; |
|---|
| | 73 | } |
|---|
| | 74 | if( p_format->i_rate < 4000 ) |
|---|
| | 75 | { |
|---|
| | 76 | msg_Err( p_aout, "too low audio sample frequency (%u)", |
|---|
| 66 | 77 | p_format->i_rate ); |
|---|
| 67 | 78 | return NULL; |
|---|