Re: [libav-devel] [PATCH] hvcc: zero initialize the nal buffers past the last written byte

2018-02-22 Thread Luca Barbato

On 23/02/2018 04:17, James Almer wrote:

Bug-Id: 1116
Cc: libav-sta...@libav.org

Signed-off-by: James Almer 
---
  libavformat/hevc.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/libavformat/hevc.c b/libavformat/hevc.c
index f8bfeebd3..1f8a7bb3c 100644
--- a/libavformat/hevc.c
+++ b/libavformat/hevc.c
@@ -657,6 +657,8 @@ static uint8_t *nal_unit_extract_rbsp(const uint8_t *src, 
uint32_t src_len,
  while (i < src_len)
  dst[len++] = src[i++];
  
+memset(dst + len, 0, AV_INPUT_BUFFER_PADDING_SIZE);

+
  *dst_len = len;
  return dst;
  }



Sounds good.

lu
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

[libav-devel] [PATCH] hvcc: zero initialize the nal buffers past the last written byte

2018-02-22 Thread James Almer
Bug-Id: 1116
Cc: libav-sta...@libav.org

Signed-off-by: James Almer 
---
 libavformat/hevc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/hevc.c b/libavformat/hevc.c
index f8bfeebd3..1f8a7bb3c 100644
--- a/libavformat/hevc.c
+++ b/libavformat/hevc.c
@@ -657,6 +657,8 @@ static uint8_t *nal_unit_extract_rbsp(const uint8_t *src, 
uint32_t src_len,
 while (i < src_len)
 dst[len++] = src[i++];
 
+memset(dst + len, 0, AV_INPUT_BUFFER_PADDING_SIZE);
+
 *dst_len = len;
 return dst;
 }
-- 
2.16.2

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel