Handle invalid encoded data

Return empty for invalid encoded data size