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

Francois Cartegnie git at videolan.org
Fri Oct 11 17:28:31 CEST 2019


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

packetizer_helper: fix potential junk on drain

computation is wrong and results in no GetBytes

(cherry picked from commit a2f4b96f6e9721fc0aa71da1c768b4f1e49957d1)

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

 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 3edd61c66e..39747ef930 100644
--- a/modules/packetizer/packetizer_helper.h
+++ b/modules/packetizer/packetizer_helper.h
@@ -172,9 +172,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 )
                     return NULL;



More information about the vlc-commits mailing list