The purpose of this commit is to make error management simpler and less error prone, just like av_free() which is safe with NULL.