[vlc-commits] packetizer_helper: fix potential junk on drain

Francois Cartegnie git at videolan.org
Fri Sep 27 19:39:19 CEST 2019


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Sep 27 19:09:34 2019 +0200| [a2f4b96f6e9721fc0aa71da1c768b4f1e49957d1] | committer: Francois Cartegnie

packetizer_helper: fix potential junk on drain

computation is wrong and results in no GetBytes

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

 modules/packetizer/packetizer_helper.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/packetizer/packetizer_helper.h b/modules/packetizer/packetizer_helper.h
index c2ef611e44..e002e8265c 100644
--- a/modules/packetizer/packetizer_helper.h
+++ b/modules/packetizer/packetizer_helper.h
@@ -166,9 +166,9 @@ static block_t *packetizer_PacketizeBlock( packetizer_t *p_pack, block_t **pp_bl
 
                 /* When flusing and we don't find a startcode, suppose that
                  * the data extend up to the end */
-                block_ChainProperties( p_pack->bytestream.p_chain,
-                                       NULL, &p_pack->i_offset, NULL );
-                p_pack->i_offset -= p_pack->bytestream.i_block_offset;
+                p_pack->i_offset = block_BytestreamRemaining(&p_pack->bytestream);
+                if( p_pack->i_offset == 0 )
+                    return NULL;
 
                 if( p_pack->i_offset <= (size_t)p_pack->i_startcode &&
                     (p_pack->bytestream.p_block->i_flags & BLOCK_FLAG_AU_END) == 0 )



More information about the vlc-commits mailing list