Initialize the variable "segid" to prevent the usage of junk value. Dont dereference the spectral-lmac object if the same is NULL. Change-Id: I5206a99017f77e5c94368d91171a7eb05745933c