[vlc-devel] [PATCH] packetizer/av1: Fix size calculation in AV1_OBUSkipHeader
Marvin Scholz
epirat07 at gmail.com
Thu Nov 29 15:53:14 CET 2018
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.
---
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;
--
2.17.1 (Apple Git-112)
More information about the vlc-devel
mailing list