diff --git a/filter/mog.go b/filter/mog.go index b86e1cdf..ca318140 100644 --- a/filter/mog.go +++ b/filter/mog.go @@ -87,7 +87,7 @@ func (m *MOGFilter) Write(f []byte) (int, error) { m.hfCount = 0 img, err := gocv.IMDecode(f, gocv.IMReadColor) if err != nil { - return len(f), fmt.Errorf("image can't be decoded: %w", err) + return 0, fmt.Errorf("image can't be decoded: %w", err) } defer img.Close()