diff mbox

[FFmpeg-devel] avformat/hevc: zero initialize the nal buffers past the last written byte

Message ID 20180223030554.5280-1-jamrial@gmail.com
State Accepted
Commit dc40e64adb1712b1209c018914a44f809bc32664
Headers show

Commit Message

James Almer Feb. 23, 2018, 3:05 a.m. UTC
Prevents use of uninitialized values.

Fixes ticket #7038.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavformat/hevc.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Michael Niedermayer Feb. 24, 2018, 2:42 a.m. UTC | #1
On Fri, Feb 23, 2018 at 12:05:54AM -0300, James Almer wrote:
> Prevents use of uninitialized values.
> 
> Fixes ticket #7038.
> 
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>  libavformat/hevc.c | 2 ++
>  1 file changed, 2 insertions(+)

probably ok

thx

[...]
James Almer Feb. 24, 2018, 3:32 a.m. UTC | #2
On 2/23/2018 11:42 PM, Michael Niedermayer wrote:
> On Fri, Feb 23, 2018 at 12:05:54AM -0300, James Almer wrote:
>> Prevents use of uninitialized values.
>>
>> Fixes ticket #7038.
>>
>> Signed-off-by: James Almer <jamrial@gmail.com>
>> ---
>>  libavformat/hevc.c | 2 ++
>>  1 file changed, 2 insertions(+)
> 
> probably ok
> 
> thx

Pushed, thanks.
diff mbox

Patch

diff --git a/libavformat/hevc.c b/libavformat/hevc.c
index e45d2c08d2..3628d5a028 100644
--- a/libavformat/hevc.c
+++ b/libavformat/hevc.c
@@ -669,6 +669,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;
 }