[vlc-commits] packetizer/av1: Fix size calculation in AV1_OBUSkipHeader

Marvin Scholz git at videolan.org
Mon Feb 24 17:44:19 CET 2020


vlc/vlc-3.0 | branch: master | Marvin Scholz <epirat07 at gmail.com> | Thu Nov 29 15:53:14 2018 +0100| [2ec179b7d820b5942f42c571be67948e651d30a0] | committer: Marvin Scholz

packetizer/av1: Fix size calculation in AV1_OBUSkipHeader

In case that AV1_OBUHasSizeField is false, i_header was used
uninitialized. The OBU header is always at least 1 byte and
the extension field is unrelated to the fact if a size field
exists or not.

Signed-off-by: Francois Cartegnie <fcvlcdev at free.fr>
(cherry picked from commit e3ada8723d47f6e7df8babdfee78d039b22a8b3b)
Signed-off-by: Marvin Scholz <epirat07 at gmail.com>

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

 modules/packetizer/av1_obu.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/packetizer/av1_obu.h b/modules/packetizer/av1_obu.h
index db71f7c8dc..a4e9cc44b7 100644
--- a/modules/packetizer/av1_obu.h
+++ b/modules/packetizer/av1_obu.h
@@ -112,14 +112,14 @@ static bool AV1_OBUSkipHeader(const uint8_t **pp_buf, size_t *pi_buf)
 {
     if(*pi_buf < 1)
         return false;
-    size_t i_header;
+    size_t i_header = 1 + !!AV1_OBUHasExtensionField(*pp_buf);
     if(AV1_OBUHasSizeField(*pp_buf))
     {
         uint8_t i_len;
         (void) AV1_OBUSize(*pp_buf, *pi_buf, &i_len);
         if(i_len == 0)
             return false;
-        i_header = 1 + !!AV1_OBUHasExtensionField(*pp_buf) + i_len;
+        i_header += i_len;
     }
     if(i_header > *pi_buf)
         return false;



More information about the vlc-commits mailing list