[vlc-commits] avcodec audio decoder: bump arbitrary decoded frame size limit

Rafaël Carré git at videolan.org
Sat Mar 2 16:40:38 CET 2013


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Sat Mar  2 16:27:38 2013 +0100| [2ff3b97ba534977e08c119204a977c44a20b00d7] | committer: Rafaël Carré

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)

TODO: port to avcodec_decode_audio4

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2ff3b97ba534977e08c119204a977c44a20b00d7
---

 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 7d7775e..b3ae8a2 100644
--- a/modules/codec/avcodec/audio.c
+++ b/modules/codec/avcodec/audio.c
@@ -181,8 +181,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