Model Rule 1.8(d) states that "prior to the conclusion of representation of a client, a lawyer shall not make or negotiate an agreement giving the lawyer literary or media rights to a portrayal or account based in substantial part on information relating to the representation." Most jurisdictions probably have a similar rule, the purpose of which, obviously, is to make sure an attorney is not distracted by his or her personal interest in making money off the future book or movie. It is a pretty simple rule and I don't remember having seen too many cases about it.
In one of those rare cases, the Legal Profession blog is reporting today that the Indiana Court of Appeals has reversed a murder conviction in a case where the prosecutor had entered into a (now cancelled) literary contract for a book. The case is Camm v Indiana and it is available here. For more on the case, go to the Legal Profession blog here.