vlc | branch: master | Thomas Guillem <[email protected]> | Thu Oct  3 16:02:52 
2019 +0200| [4aa3c892b7d404811555e6dc2bdc21ee73be93ea] | committer: Thomas 
Guillem

tospdif: A52: fix buffer size check

When an AC-3 Core + EAC3 ext (gathered from the packetizer) block was passed,
the buffer size was equal to a52_size and didn't triggered the a52 reparse that
removed the EAC3 extension.

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

 modules/audio_filter/converter/tospdif.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/audio_filter/converter/tospdif.c 
b/modules/audio_filter/converter/tospdif.c
index 5b11cace29..60f3e66544 100644
--- a/modules/audio_filter/converter/tospdif.c
+++ b/modules/audio_filter/converter/tospdif.c
@@ -219,7 +219,7 @@ static int write_buffer_ac3( filter_t *p_filter, block_t 
*p_in_buf )
     static const size_t a52_size = A52_FRAME_NB * 4;
 
     if( unlikely( p_in_buf->i_buffer < 6
-     || p_in_buf->i_buffer > a52_size
+     || p_in_buf->i_buffer + SPDIF_HEADER_SIZE > a52_size
      || p_in_buf->i_nb_samples != A52_FRAME_NB ) )
     {
         /* Input is not correctly packetizer. Try to parse the buffer in order

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to