git.videolan.org
/
vlc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d2f4a3f
)
Validated the audio layout and channels compatibility in aout_DecNew.
author
Laurent Aimar
<fenrir@videolan.org>
Tue, 5 May 2009 21:49:27 +0000
(23:49 +0200)
committer
Laurent Aimar
<fenrir@videolan.org>
Tue, 5 May 2009 21:53:28 +0000
(23:53 +0200)
It will avoid memory corruptions in case of a broken decoder.
src/audio_output/dec.c
patch
|
blob
|
history
diff --git
a/src/audio_output/dec.c
b/src/audio_output/dec.c
index
0c2236b
..
b31b02f
100644
(file)
--- a/
src/audio_output/dec.c
+++ b/
src/audio_output/dec.c
@@
-61,6
+61,11
@@
static aout_input_t * DecNew( aout_instance_t * p_aout,
msg_Err( p_aout, "no audio channels" );
return NULL;
}
+ if( p_format->i_channels != aout_FormatNbChannels( p_format ) )
+ {
+ msg_Err( p_aout, "incompatible audio channels count with layout mask" );
+ return NULL;
+ }
if( p_format->i_rate > 192000 )
{