From fb2a2b949c4a40f0897433881c4490bd78726132 Mon Sep 17 00:00:00 2001 From: Mattias Wadman Date: Tue, 18 Oct 2022 13:40:25 +0200 Subject: [PATCH] flac,fuzz: Fatal error on negative partition sample count --- format/flac/flac_frame.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/format/flac/flac_frame.go b/format/flac/flac_frame.go index fc380bd9..afe10dc9 100644 --- a/format/flac/flac_frame.go +++ b/format/flac/flac_frame.go @@ -452,6 +452,9 @@ func frameDecode(d *decode.D, in any) any { if samplesLen < n+count { d.Fatalf("decodeResiduals outside block size") } + if count < 0 { + d.Fatalf("negative sample count %d", count) + } if riceParameter == riceEscape { escapeSampleSize := int(d.FieldU5("escape_sample_size"))