diff --git a/codec/mjpeg/jpeg.go b/codec/mjpeg/jpeg.go index d669e57d..10e53e58 100644 --- a/codec/mjpeg/jpeg.go +++ b/codec/mjpeg/jpeg.go @@ -251,9 +251,7 @@ func (c *Context) ParsePayload(p []byte, m bool) error { qLen = len(qTable) } - c.blen = 0 - - c.blen += writeHeader(c.buf[c.blen:], int(t), int(width), int(height), qLen/64, dri, qTable) + c.blen = writeHeader(c.buf[c.blen:], int(t), int(width), int(height), qLen/64, dri, qTable) } if c.blen == 0 {