vlc/vlc-3.0 | branch: master | Francois Cartegnie <[email protected]> | 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;

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

Reply via email to