mirror of https://git.ffmpeg.org/ffmpeg.git
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>
This commit is contained in:
parent
cc13bc8c4f
commit
382a68b008
|
@ -34,7 +34,7 @@ int ff_h2645_extract_rbsp(const uint8_t *src, int length,
|
||||||
{
|
{
|
||||||
int i, si, di;
|
int i, si, di;
|
||||||
uint8_t *dst;
|
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;
|
nal->skipped_bytes = 0;
|
||||||
#define STARTCODE_TEST \
|
#define STARTCODE_TEST \
|
||||||
|
@ -90,8 +90,8 @@ int ff_h2645_extract_rbsp(const uint8_t *src, int length,
|
||||||
return 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);
|
length + padding);
|
||||||
if (!nal->rbsp_buffer)
|
if (!nal->rbsp_buffer)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue