[vlc-devel] commit: Improved flac SyncInfo robustness by using stream info when available ( close 1847). (Laurent Aimar )

git version control git at videolan.org
Mon Aug 18 19:39:24 CEST 2008


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Mon Aug 18 16:03:55 2008 +0200| [9aba8655bc20754bddd83c3733059c6846145826] | committer: Laurent Aimar 

Improved flac SyncInfo robustness by using stream info when available (close 1847).

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

 modules/codec/flac.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/modules/codec/flac.c b/modules/codec/flac.c
index f346c71..0fb3d01 100644
--- a/modules/codec/flac.c
+++ b/modules/codec/flac.c
@@ -1058,6 +1058,13 @@ static int SyncInfo( decoder_t *p_dec, uint8_t *p_buf,
         return 0;
     }
 
+    /* Sanity check using stream info header when possible */
+    if( p_sys->b_stream_info )
+    {
+        if( i_blocksize < p_sys->stream_info.min_blocksize ||
+            i_blocksize > p_sys->stream_info.max_blocksize )
+            return 0;
+    }
     return i_blocksize;
 }
 




More information about the vlc-devel mailing list