From 08264f7bf546ecb0f839c50158af89dc3eca6faa Mon Sep 17 00:00:00 2001 From: Saxon Date: Sun, 20 Oct 2019 09:17:03 +1030 Subject: [PATCH] codec/h264/h264dec/fuzz/fuzzParseLevelPrefix/fuzz.go: swapped got and want to correct orientation --- codec/h264/h264dec/fuzz/fuzzParseLevelPrefix/fuzz.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/codec/h264/h264dec/fuzz/fuzzParseLevelPrefix/fuzz.go b/codec/h264/h264dec/fuzz/fuzzParseLevelPrefix/fuzz.go index 3910ac58..6dd92378 100644 --- a/codec/h264/h264dec/fuzz/fuzzParseLevelPrefix/fuzz.go +++ b/codec/h264/h264dec/fuzz/fuzzParseLevelPrefix/fuzz.go @@ -48,21 +48,21 @@ func Fuzz(data []byte) int { // 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. - got := C.read_levelprefix(cbr) - if got < 0 { + want := C.read_levelprefix(cbr) + if want < 0 { return -1 } // Get the level_prefix from the go code. If the C code was okay with this // input, but the go code isn't then that's bad, so panic - want crasher info. - want, err := h264dec.FuzzParseLevelPrefix(bits.NewBitReader(bytes.NewReader(data))) + got, err := h264dec.FuzzParseLevelPrefix(bits.NewBitReader(bytes.NewReader(data))) if err != nil { panic(fmt.Sprintf("error from go parseLevelPrefix: %v", err)) } // Compare the result of the C and go code. If they are not the same then // panic - our go code is not doing what it should. - if int(want) != int(got) { + if int(got) != int(want) { panic(fmt.Sprintf("did not get expected results for input: %v\nGot: %v\nWant: %v\n", data, got, want)) } return 1