Decoder: check whether the surface for decoding output is valid