From c692fab1c2ff0de2554c5940f77ac8c168e729b2 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sat, 17 Dec 2022 15:08:10 +0100 Subject: pkg/image: treat empty compressed image as valid image When we decompress images for mutation or hints, we always specially check for empty compressed data (I assume it can apper after minimization). Treat it as correct compressed and return empty decompressed data. This removes the need in special handling in users. --- prog/mutation.go | 3 --- 1 file changed, 3 deletions(-) (limited to 'prog/mutation.go') diff --git a/prog/mutation.go b/prog/mutation.go index 09fdfa69c..07b524fe2 100644 --- a/prog/mutation.go +++ b/prog/mutation.go @@ -385,9 +385,6 @@ func (t *BufferType) mutate(r *randGen, s *state, arg Arg, ctx ArgCtx) (calls [] } func (r *randGen) mutateImage(compressed []byte) (data []byte, retry bool) { - if len(compressed) == 0 { - return compressed, true - } data, dtor := image.MustDecompress(compressed) defer dtor() if len(data) == 0 { -- cgit mrf-deployment