[vlc-commits] avcodec audio decoder: bump arbitrary decoded frame size limit
Rafaël Carré
git at videolan.org
Mon Apr 1 21:08:35 CEST 2013
vlc/vlc-2.0 | branch: master | Rafaël Carré <funman at videolan.org> | Sat Mar 2 16:27:38 2013 +0100| [a481fd6989dc166aaf8cf7023ff7b2890f72cffa] | committer: Jean-Baptiste Kempf
avcodec audio decoder: bump arbitrary decoded frame size limit
The limit can be reached with some WMA samples:
[wmav2 @ 0x7f9c50c1e960] output buffer size is too small for the current frame (192000 < 196608)
(cherry picked from commit 2ff3b97ba534977e08c119204a977c44a20b00d7)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=a481fd6989dc166aaf8cf7023ff7b2890f72cffa
---
modules/codec/avcodec/audio.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c
index 312cd62..ae3f945 100644
--- a/modules/codec/avcodec/audio.c
+++ b/modules/codec/avcodec/audio.c
@@ -234,8 +234,8 @@ int InitAudioDec( decoder_t *p_dec, AVCodecContext *p_context,
p_sys->i_output_max = 0;
break;
}
- if( p_sys->i_output_max < AVCODEC_MAX_AUDIO_FRAME_SIZE )
- p_sys->i_output_max = AVCODEC_MAX_AUDIO_FRAME_SIZE;
+ if( p_sys->i_output_max < 2 * AVCODEC_MAX_AUDIO_FRAME_SIZE )
+ p_sys->i_output_max = 2 * AVCODEC_MAX_AUDIO_FRAME_SIZE;
msg_Dbg( p_dec, "Using %d bytes output buffer", p_sys->i_output_max );
p_sys->p_output = av_malloc( p_sys->i_output_max );
More information about the vlc-commits
mailing list