check memory errors from av_strdup()