> av_freep() should be safe to be used with NULL Since av_freep takes a pointer I am nearly sure that it doesn't, at least I remember that I had some issues without the if's… But please correct me if I'm wrong.