[vlc-commits] codec: cc: only decode valid captions

Francois Cartegnie git at videolan.org
Fri Sep 23 10:52:02 CEST 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Sep 22 23:25:01 2016 +0200| [67dd7637ff03343b1a80fcf1dcc55629ec12bdca] | committer: Francois Cartegnie

codec: cc: only decode valid captions

required to remove cc filtering ahead

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

 modules/codec/cc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/codec/cc.c b/modules/codec/cc.c
index d5f10b9..86bbf0a 100644
--- a/modules/codec/cc.c
+++ b/modules/codec/cc.c
@@ -467,7 +467,8 @@ static subpicture_t *Convert( decoder_t *p_dec, block_t **pp_block )
     while( p_block->i_buffer >= 3 && !(i_status & EIA608_STATUS_DISPLAY) )
     {
         /* Mask off the specific i_field bit, else some sequences can be lost. */
-        if ( (p_block->p_buffer[0] & 0x01) == p_sys->i_field )
+        if ( (p_block->p_buffer[0] & 0x01) == p_sys->i_field &&
+             (p_block->p_buffer[0] & 0x04) /* Valid bit */ )
             i_status = Eia608Parse( &p_sys->eia608, p_sys->i_channel, &p_block->p_buffer[1] );
 
         p_block->i_buffer -= 3;



More information about the vlc-commits mailing list