[vlc-commits] packetizer: flac: ensure blocksize range

Francois Cartegnie git at videolan.org
Fri Jan 10 15:31:36 CET 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Jan  9 21:24:01 2014 +0100| [68ad868d133bef36360a154335fcb9e014237b8c] | committer: Francois Cartegnie

packetizer: flac: ensure blocksize range

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

 modules/packetizer/flac.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/modules/packetizer/flac.c b/modules/packetizer/flac.c
index 7673390..3fe9bf4 100644
--- a/modules/packetizer/flac.c
+++ b/modules/packetizer/flac.c
@@ -134,7 +134,11 @@ static void ProcessHeader(decoder_t *p_dec)
     bs_init(&bs, p_extra, i_extra);
 
     p_sys->stream_info.min_blocksize = bs_read(&bs, 16);
+    p_sys->stream_info.min_blocksize =
+            __MIN( __MAX( p_sys->stream_info.min_blocksize, 16 ), 65535 );
     p_sys->stream_info.max_blocksize = bs_read(&bs, 16);
+    p_sys->stream_info.max_blocksize =
+                __MAX( __MIN( p_sys->stream_info.max_blocksize, 65535 ), 16 );
 
     p_sys->stream_info.min_framesize = bs_read(&bs, 24);
     p_sys->stream_info.max_framesize = bs_read(&bs, 24);



More information about the vlc-commits mailing list