From d0f99b581d7be59cb83a0e26577031554817407c Mon Sep 17 00:00:00 2001 From: Saxon Date: Sun, 20 Oct 2019 09:29:22 +1030 Subject: [PATCH] codec/h264/h264dec/fuzz/helpers.c: checking if malloc bit reader mem returns NULL --- codec/h264/h264dec/fuzz/fuzzParseLevelPrefix/fuzz.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/codec/h264/h264dec/fuzz/fuzzParseLevelPrefix/fuzz.go b/codec/h264/h264dec/fuzz/fuzzParseLevelPrefix/fuzz.go index 6dd92378..9ee88dd1 100644 --- a/codec/h264/h264dec/fuzz/fuzzParseLevelPrefix/fuzz.go +++ b/codec/h264/h264dec/fuzz/fuzzParseLevelPrefix/fuzz.go @@ -45,6 +45,9 @@ import ( func Fuzz(data []byte) int { // Create C based BitReader based on data. cbr := C.new_BitReader((*C.char)(unsafe.Pointer(&data[0])), C.int(len(data))) + if cbr == nil { + panic("new_BitReader returned NULL pointer") + } // Get the level_prefix from the C code. If got is < 0, then the C code // doesn't like it and we shouldn't have that input in the corpus, so return -1.