summaryrefslogtreecommitdiffstats
path: root/libavcodec/h2645_parse.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-08-18 22:23:32 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2016-08-18 23:36:18 +0200
commit382a68b0088b06b8df20d0133d767d53d8f161ef (patch)
tree0dfb57b545a2496ba81ef1955c70b3f7ade2a03c /libavcodec/h2645_parse.c
parentcc13bc8c4f0f4afa30d0b94c3f3a369ccd2aaf0b (diff)
downloadffmpeg-streaming-382a68b0088b06b8df20d0133d767d53d8f161ef.zip
ffmpeg-streaming-382a68b0088b06b8df20d0133d767d53d8f161ef.tar.gz
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>
Diffstat (limited to 'libavcodec/h2645_parse.c')
-rw-r--r--libavcodec/h2645_parse.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/h2645_parse.c b/libavcodec/h2645_parse.c
index 4ed4c9a..e92e38a 100644
--- a/libavcodec/h2645_parse.c
+++ b/libavcodec/h2645_parse.c
@@ -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,8 +90,8 @@ int ff_h2645_extract_rbsp(const uint8_t *src, int length,
return length;
}
- av_fast_malloc(&nal->rbsp_buffer, &nal->rbsp_buffer_size,
- length + padding);
+ av_fast_padded_malloc(&nal->rbsp_buffer, &nal->rbsp_buffer_size,
+ length + padding);
if (!nal->rbsp_buffer)
return AVERROR(ENOMEM);
OpenPOWER on IntegriCloud