vcodec/h2645_parse: Clear buffer padding
Fixes use of uninitialized memory
Fixes: 044100cb22845944988a4bd821ff8074/asan_heap-oob_329927a_1366_c3de34ce9217dac820fbb46171031bbb.jsv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 382a68b008
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -34,7 +34,7 @@ int ff_h2645_extract_rbsp(const uint8_t *src, int length,
|
||||
{
|
||||
int i, si, di;
|
||||
uint8_t *dst;
|
||||
int64_t padding = small_padding ? AV_INPUT_BUFFER_PADDING_SIZE : MAX_MBPAIR_SIZE;
|
||||
int64_t padding = small_padding ? 0 : MAX_MBPAIR_SIZE;
|
||||
|
||||
nal->skipped_bytes = 0;
|
||||
#define STARTCODE_TEST \
|
||||
@@ -90,7 +90,7 @@ int ff_h2645_extract_rbsp(const uint8_t *src, int length,
|
||||
return length;
|
||||
}
|
||||
|
||||
av_fast_malloc(&nal->rbsp_buffer, &nal->rbsp_buffer_size,
|
||||
av_fast_padded_malloc(&nal->rbsp_buffer, &nal->rbsp_buffer_size,
|
||||
length + padding);
|
||||
if (!nal->rbsp_buffer)
|
||||
return AVERROR(ENOMEM);
|
||||
|
Reference in New Issue
Block a user