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

Marvin Scholz git at videolan.org
Tue Jan 8 16:52:09 CET 2019


vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Thu Nov 29 15:53:14 2018 +0100| [e3ada8723d47f6e7df8babdfee78d039b22a8b3b] | committer: Francois Cartegnie

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>

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

 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 ca17b2421b..b3082a759d 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