[vlc-commits] [Git][videolan/vlc][master] 3 commits: rtp: hevc: remove assert

François Cartegnie (@fcartegnie) gitlab at videolan.org
Thu Mar 7 10:33:51 UTC 2024



François Cartegnie pushed to branch master at VideoLAN / VLC


Commits:
affb3944 by François Cartegnie at 2024-03-07T10:06:20+00:00
rtp: hevc: remove assert

UDP is unreliable

- - - - -
42cb098d by François Cartegnie at 2024-03-07T10:06:20+00:00
rtp: hevc: fix off by one in the check

- - - - -
3d1ac633 by François Cartegnie at 2024-03-07T10:06:20+00:00
rtp: hevc: fix inverted buffer op

- - - - -


1 changed file:

- modules/access/rtp/h265.c


Changes:

=====================================
modules/access/rtp/h265.c
=====================================
@@ -100,7 +100,7 @@ static block_t * h265_deaggregate_AP(block_t *block, bool b_donl, bool b_annexb)
     size_t sz = block->i_buffer;
 
     /* first pass, compute final size */
-    while(sz > (b_donl ? 2 : 1))
+    while(sz > (b_donl ? 3 : 2))
     {
         /* skip 1/2 DONL or DOND here */
         if(b_donl)
@@ -110,10 +110,7 @@ static block_t * h265_deaggregate_AP(block_t *block, bool b_donl, bool b_annexb)
         }
         size_t nalsz = GetWBE(p);
         if(nalsz + 2 > sz)
-        {
-            vlc_assert_unreachable();
             break;
-        }
         total += nalsz + 4;
         sz -= (nalsz + 2);
         p += (nalsz + 2);
@@ -124,7 +121,7 @@ static block_t * h265_deaggregate_AP(block_t *block, bool b_donl, bool b_annexb)
         uint8_t *dst = newblock->p_buffer;
         p = block->p_buffer;
         sz = block->i_buffer;
-        while(sz > (b_donl ? 2 : 1))
+        while(sz > (b_donl ? 3 : 2))
         {
             /* skip 1/2 DONL or DOND here */
             if(b_donl)
@@ -242,8 +239,8 @@ static void rtp_h265_decode (struct vlc_rtp_pt *pt, void *data, block_t *block,
             block->p_buffer[0] = (block->p_buffer[0] & 0x81) | (cType << 1);
             block->p_buffer[4 + PHSize - 2 + 0] = block->p_buffer[0];
             block->p_buffer[4 + PHSize - 2 + 1] = block->p_buffer[1];
-            block->p_buffer -= 4 + PHSize;
-            block->i_buffer += 4 + PHSize;
+            block->p_buffer += 4 + PHSize;
+            block->i_buffer -= 4 + PHSize;
             /* pass to original payload handler */
             rtp_h265_decode(pt, data, block, info);
             break;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/6ea08ff624fe3f16239ab1932b238159ce5e6883...3d1ac63351395a9d0c4df55115ae962df648ef04

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/6ea08ff624fe3f16239ab1932b238159ce5e6883...3d1ac63351395a9d0c4df55115ae962df648ef04
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list